Skip to content
DaevMithranPublic

About

Agent Grant Negotiation and Authorization Protocol

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

AGNAP

Agent Grant Negotiation and Authorization Protocol

A grant, not a credential.

AGNAP is an open project exploring how to give an agent permission for one specific task and enforce that permission outside the agent's control. Each agent instance gets its own key-bound grant that names exact operations and argument constraints. A separate executor holds the service credentials and checks every call against that grant.

GNAP (RFC 9635) is the first grant server protocol used by the project. The architecture is pluggable: a local grant server, AAuth and OAuth-based grant servers are considered as alternatives. In GNAP terms the grant server is the authorization server (AS).

Talk at Ubucon India 2026: slides.

The problem

An owner asks an agent:

Read the issues in acme/docs and summarize them. Ask me before posting a comment.

The available service credential may also permit writing comments, editing issues or accessing other repositories. Keeping that credential out of the model's prompt does not restrict what a tool can do with it.

The desired behavior is straightforward:

  • Reading issues in acme/docs is allowed.
  • Reading another repository is denied.
  • Posting a comment needs additional permission.
  • Cancelling the task prevents subsequent authorized calls.
  • The agent receives results without receiving the service credential.

AGNAP's goal is to enforce those decisions even if the agent ignores its task instructions or bypasses a runtime approval hook. The design assumes any agent instance may be malicious, and that anything inside its process (prompts, hooks, its own checks) can be bypassed.

Runtime tool approval can collect intent, but it is not an enforcement boundary unless every effect passes through it and the decision is bound to the exact request.

The core authorization question is:

Which agent instance may perform which operation, on which resource, under which constraints, and what may it delegate?

Two parts: one decides, the other enforces

The grant server decides and never holds a service credential. The executor holds the credentials, checks every call and never approves anything.

What a grant says

The agent_operation access type names allowed operations, constrains their arguments and sets ceilings. For example, list issues in one repository, at most twenty times:

A grant JSON with a call ceiling, next to the argument constraints.

Operation names such as github.issues.list are not standardised. Each deployment defines them, and the executor's connector config maps each name to a real API call. A grant is a closed world: any operation or argument it doesn't name is denied. To allow any value for an argument, name it with wildcard, as state is here. The grant checks values only. The tool's own schema still checks required fields and types.

The full constraint vocabulary, including not_one_of, contains and subset, is in packages/specs. Each constraint also defines containment, meaning whether one grant is no wider than another, which child grants rely on. Ceilings are checked against the grant state record.

Getting a grant

sequenceDiagram
    participant A as Agent
    participant GS as Grant server
    participant O as Owner

    A->>GS: Grant request: operations, arguments, ceilings<br/>(signed with the agent's key)
    GS->>O: Ask for approval
    O-->>GS: Approve, narrow or deny
    GS-->>A: Key-bound access token and continue endpoint
    A->>GS: Update the grant through continue
    GS->>O: Ask for approval of the difference
Loading

A grant is not a one-time token. The grant response carries a continue endpoint (RFC 9635, section 5) that the client keeps for the life of the grant. The agent uses it to ask for more as its work evolves, and the owner approves only the difference. The owner can narrow a grant at the grant server at any time. Because the executor checks every call, the next call sees the change.

A deploy agent's grant extended with three operations, then narrowed by one after a failed rollout.

Using a grant

sequenceDiagram
    participant A as Agent
    participant E as Executor
    participant GS as Grant server
    participant S as Service

    A->>E: Operation and arguments, token, request signature
    E->>GS: Introspect the token (RFC 9767)
    GS-->>E: Active? Granted access, bound key, root grant
    E->>E: Verify the signature against the bound key
    E->>E: Check the operation and arguments against the grant
    E->>E: Reserve the call on the grant state record
    E->>S: Perform the operation with the service credential
    S-->>E: Result or failure
    E->>E: Settle the reservation
    E-->>A: Result only
Loading

Nothing reaches the service unless every check passes. The service keeps its existing authentication and never sees GNAP.

Delegation narrows the grant

A parent requests the permission its child needs. The grant server checks that request against the parent's grant, owner rules, maximum depth and trusted lineage evidence. Each child has its own key and grant in the GNAP deployment, or a separately protected session binding with a local grant server.

An agent tree where each child has its own key and a narrower grant, one grant state record counts ten comments across the tree, and revoking A stops A1 and A2.

sequenceDiagram
    participant Parent as Parent agent
    participant GS as Grant server
    participant State as Grant state record
    participant Child as Child agent

    Parent->>Child: Spawn with narrower task
    Child->>GS: Request child grant with caller binding and lineage evidence
    GS->>GS: Verify lineage and caller binding
    GS->>GS: Check the requested grant fits inside the parent's
    GS->>State: Check root grant, lineage and ceilings
    State-->>GS: Return current grant state
    GS-->>Child: Issue child grant linked to root state
    Note over State,Child: Children count against the root grant's ceilings
Loading

The owner can permit automatic approval of contained child requests or require approval for each one. Both modes enforce containment, depth and the root grant's ceilings. A child wider than its parent is denied. If more access is needed, the system must obtain a new owner decision through an explicit root grant change. It cannot place a wider grant beneath an unchanged, narrower parent.

Children reference the root's grant state record rather than receiving copies of its ceilings. The executor reserves against a ceiling atomically before an effect, then records confirmed use or releases it after confirmed failure. An unknown outcome keeps the reservation until reconciliation. Retries require service-specific idempotency or reconciliation. A timeout is not proof that an operation failed.

See the detailed delegation sequence.

Roles

Role Responsibility
Owner Requests the task and approves grants, directly or through standing policy
Agent runtime Runs the agent, requests grants and sends tool calls
Grant server Issues grants, tracks their lifetime and revocation, and answers introspection
Executor Checks each call against the grant, protects service credentials, performs the call
Services Perform operations using their existing APIs and authentication

An MCP gateway or an agent gateway such as agentgateway can play the executor, since it already sits between the agent and its tools.

The executor

AGNAP is independent of any tool protocol or execution framework. The executor maps a concrete request to the granted operation, verifies the caller and exact effect, protects downstream credentials, and fails closed when authorization cannot be established. The checked request must remain unchanged through execution. The executor must remain outside agent control and mediate every path capable of producing the protected effect.

See the executor adapter contract for detailed requirements.

Authority model

An effective authorization decision combines four things:

  1. Instance binding: which verified key or protected local session is presenting the request, and which executor it is authorized to use.
  2. The grant: the approved operations, argument constraints, validity window and any ceiling definitions for that instance.
  3. Grant state record: expiry and revocation, plus ancestor state and the calls counted against the grant's ceilings across a delegation tree.
  4. Executor policy: the executor's own rules and the downstream credential's own permissions.

With GNAP, the agent carries a key-bound token containing or referencing the grant. With a local grant server, the executor retrieves a protected grant record associated with the agent's session. The agent cannot edit either form of the grant. Revocation and the grant state record remain on the trusted side.

Why GNAP, and where other providers fit

GNAP provides structured access requests, client-instance keys, owner interaction and an ongoing grant continuation mechanism. Those features make it AGNAP's first grant server protocol.

GNAP requires a client key for grant requests and key-bound continuation tokens. It also permits bearer resource access tokens. The proposed AGNAP GNAP profile chooses key-bound access tokens and a distinct key per agent instance. That instance mapping is an AGNAP choice. RFC 9767 supplies the resource-server connections used for token validation.

GNAP leaves decision policy to the server: issue the requested access, issue a narrower subset, wait for the owner, or deny. Changing that policy does not require changing the protocol.

AAuth and an OAuth-based grant server (with DPoP and rich authorization requests) are alternatives where portable grants are needed. A provider mapping must preserve proof and lifecycle rules. It must not widen permissions. Either GNAP or AAuth can sit behind a gateway while downstream services keep their existing authentication.

Requirements

The key words MUST and MUST NOT are to be interpreted as described in BCP 14.

Grant server

  • G1. The grant server MUST NOT hold service credentials or call services.
  • G2. Every access token it issues for an agent MUST be bound to that agent instance's key.
  • G3. It MUST NOT issue a grant wider than the owner approved, and MUST reject an owner approval wider than the request.
  • G4. Introspection MUST reflect the grant's current state, so that narrowing or revocation applies to the next call.
  • G5. A child grant MUST be contained in its parent's grant and MUST reference the root grant's state.

Executor

  • E1. The executor MUST hold service credentials outside the agent's reach and MUST NOT return them to the agent.
  • E2. It MUST verify each request's signature against the key the token is bound to, with replay protection.
  • E3. It MUST check the operation and every argument against the grant, and MUST deny anything the grant does not name.
  • E4. When the grant sets a ceiling, it MUST reserve against the grant state record before calling the service.
  • E5. It MUST NOT approve or widen a grant.
  • E6. It MUST fail closed when the grant cannot be validated, for example when introspection fails.
  • E7. It MUST mediate every path that can produce the protected effect.

Design documents

AGNAP separates shared grant semantics from provider-specific protocols. Each guarantee must be attributed to the protocol, runtime, executor or downstream service that enforces it.

Provider mappings require explicit caller-binding and lifecycle semantics. They must not be inferred by dropping key checks from the GNAP profile.

Quick start

Requires Node 22.13 or later and pnpm.

pnpm install
pnpm build

To see it work, follow the DeepSeek Harness walkthrough: an agent requests grants, you approve, narrow or deny them from the owner CLI, and the agent's tool calls run only within what you approved. To run the executor on its own, see executor.

Package What it is
gnap-server The grant server
executor agnapd, the executor and grant state record
owner agnap-owner, the owner CLI
access-types The agent_operation access type
gnap-core GNAP messages, HTTP signatures and keys
deepseek DeepSeek Harness adapter
specs Schemas the wire types are generated from

Status

Proposal and specification under development, with a working proof of concept: the grant server, the owner CLI, the executor with the grant state record and call ceilings, and a DeepSeek Harness plugin. Child grants, cascading revocation and the remaining argument constraints are specified but not built. Each package README describes what is implemented.

Related work

These systems and research inform the proposal, supply potential components and provide comparison targets. Evaluate caller binding, task scope, credential custody, delegation and accounting against concrete effects. Their combination must not be assumed unique to AGNAP.

  • Attenuating Authorization Tokens (AAT): narrowing authority through agent delegation chains, and a reference for containment and portable authority.
  • Credential Delegation Protocol: credential delegation across systems, directly relevant to the executor.
  • Delegation Without Trust: identity, authorization and runtime governance research informing tests of compromised children, caller binding and replay.
  • AAuth: a close architectural alternative and potential provider for mission-based authorization, also deployable behind a gateway.
  • Caracal: a reference for authority, narrowing delegation, revocation and audit. Compare its sessions with runtime-observed instances and task state.
  • Amazon Bedrock AgentCore Policy: gateway-enforced policy and temporal sessions, and a reference for argument checks and session accounting.

Participate

Feedback is welcome on threat models, operation profiles, runtime identity, local isolation and reproducible enforcement tests. Use GitHub Issues for proposals and architecture discussions. Follow CONTRIBUTING.md and the Code of Conduct.

Report vulnerabilities through SECURITY.md.

Funding and collaboration

The project seeks grant support and institutional collaborators for specification development, interoperability and independent security evaluation. A possible Internet-Draft would address demonstrated interoperability needs.

License

Apache License 2.0.

About

Agent Grant Negotiation and Authorization Protocol

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages