0.24.20: Approval and Policy Enforcement
This release fixes two security problems and makes invocation behaviour the same in every runtime. The protocol version stays anip/0.24.
- Runtimes: a security fix. Approval grants could be redeemed by another principal in all five runtimes, and Go, Java and C# skipped checks on streaming invocations. Advisory: GHSA-xpvx-ppxm-q7p5.
- Generator: a security fix. Services generated by the ANIP generator allowed requests their policy bindings should refuse. Advisory: GHSA-vppc-wc4f-h4x3.
- Every runtime: one invocation behaviour. Parameters are validated against declared inputs, each failure type maps to one HTTP status, and approval digests use RFC 8785 canonical JSON.
Upgrade if you run an ANIP service that uses approvals, budgets, binding or control requirements, or streaming. If you generated a service with anip generate 0.24.5 or later, upgrade the CLI and regenerate: upgrading the runtime packages does not change generated code.
The runtime security fix
Affected: anip-service, @anip-dev/service, the Go module, dev.anip:anip-service and Anip.Service before 0.24.20.
Which checks were missing differed per runtime:
| Fault | Python | TypeScript | Go | Java | C# |
|---|---|---|---|---|---|
| An approval grant could be redeemed by a different principal | yes | yes | yes | yes | yes |
A blank approval_grant reached the handler as a supplied grant | yes | yes | |||
| Streaming skipped budget, binding and control checks | yes | yes | yes | ||
| A scope budget was not enforced when the binding carried no price | yes | yes | |||
A one_time grant could be created with more than one use | yes | yes |
All five runtimes now:
- refuse a grant redeemed by a token whose root principal differs from the grant requester's, with
grant_requester_mismatch(HTTP 403). The grant is not consumed. The requester's own tokens, fresh tokens of the same principal and tokens delegated from them can still redeem it; - treat a blank
approval_grantas a grant that does not exist (grant_not_found); - run the same pre-handler checks on streaming and unary invocations;
- refuse a budgeted call whose binding carries no price with
budget_not_enforceable; - refuse a
one_timegrant request that asks for more than one use.
If you cannot upgrade yet: do not share grant IDs beyond the requesting principal, make handlers check the grant the runtime validated rather than whether approval_grant is present, and on Go, Java and C# do not expose streaming for capabilities that rely on budgets, binding requirements or control requirements.
The conformance suite now tests approval requests and grants (conformance/test_approvals.py).
The generator security fix
Affected: the generator in the Go module and the anip CLI binaries and Homebrew formula, 0.24.5 through 0.24.19. The Studio images and desktop app and the Python, TypeScript, Java and C# runtime packages do not contain the generator.
In all five generated targets, an actor that matched none of a capability's policy bindings was allowed, a principal without actor claims was allowed, a matching deny or clarify binding could be ignored, and an approval-gated capability could reach the backend adapter without a grant.
Generated policy now fails closed:
- A matching
denybinding refuses the request withdenied, whatever the capability posture. A binding decision the host does not recognise counts asdeny. - If a capability has bindings and none matches the actor, the request is refused with
denied. A principal with no actor claims matches none. - A capability with no bindings stays allowed.
- An approval-gated capability stops with
approval_requiredbefore the backend adapter runs, unless the runtime has validated an approval grant for the invocation.
What you need to do: upgrade the CLI (brew upgrade anip or the release binaries) and regenerate your service. Check that every actor that should reach a capability is named in its bindings: an actor that was allowed only because the policy failed open is now refused.
Rules on composed capabilities are refused
The runtime runs a composed capability's steps itself, so a policy binding that named a composed capability was never enforced. Definition validation now refuses such a binding, and so do anip validate, anip-verify, anip generate, anip package build-local and Registry publication. Put the rule on the child capabilities, where it applies at each step and to direct calls of the child.
The GTM showcase package gtm-pipeline-q2-review 0.3.6 to 0.4.5 bound rules to its composed flows and no longer validates. Use 0.4.6, which moves them to the children. Under 0.4.6 the only change in effective decisions is that rev_ops_manager now reaches the approval stop on gtm.prepare_followup_tasks, which 0.4.5 declared on the composed flow but never enforced.
What changes for you: every runtime
| 0.24.19 and earlier | 0.24.20 | |
|---|---|---|
| A missing or null required input | not checked in every runtime | invalid_parameters (400) |
| A value of the wrong primitive type | not checked in every runtime | invalid_parameters (400) |
required omitted on an input | differed per runtime | defaults to true |
An input with resolution.on_missing | differed per runtime | left to the service |
parameters that is not a JSON object | differed per runtime | invalid_parameters (400) |
| HTTP status of a failure | differed per runtime and binding | one status per failure type (SPEC.md §6.3) |
| Approval digests | runtime-specific canonical JSON | RFC 8785 |
| An unrecognised credential at token issuance | differed per runtime and transport | authentication_required |
Approval digests can differ from earlier releases for some values, such as non-ASCII strings and floats. An approval request created before the upgrade may then fail to redeem; ask for a new approval.
Other changes:
- The Java Spring Boot binding serves
POST /anip/approval_grants. - The MCP and REST schemas name the JSON type the service checks for each input.
anip package build-local --source-package <bundle>carries a reviewed package's agent metadata into the new package, instead of deriving it from the definition.
Not in this release
- Parameters the capability does not declare are still accepted.
- Refusals before the handler runs are not yet audited the same way in every runtime.