A2A server entrance checks: authentication, authorization and task scoping
Split an A2A server entrance into four checks: authentication, authorization, task scope and AUTH_REQUIRED, with return codes and stop actions.
Four checks at the server entrance · Where identity comes from and what the card declares · Check 1: authenticate every request
At a glance
When you write the entrance checks for an A2A server, the usual problems are order and scope: credentials are never validated before business code runs; 403 and 404 are mixed up so a caller learns that someone else's task exists; ListTasks filters but GetTask does not; or TASK_STATE_AUTH_REQUIRED is treated as already authorized. The A2A specification (1.0.0) and the enterprise implementation page speak about these at different levels: the spec uses MUST, SHOULD and MAY, while the enterprise page uses plain-English must and should, so this article quotes them separately. It arranges the points into four checks, each with the strength of the official requirement, the return code and the stop action, then closes with a made-up set of requests and a checklist, and lists the questions the pages leave open. It relies only on these two pages, read on 2026-11-24. No A2A server or SDK was called, nothing was installed, and no request was run. Sentences marked as editorial advice are implementation choices, not official requirements.
Runtime and applicability
- Article type
- Engineering practice
- Verified
- Applies to
- A2A A2A server: check order for authentication, authorization, task scope and AUTH_REQUIRED
Execution locations and responsibilities
- The authentication layer at the A2A server entrance Validates the credentials on every request; on failure it returns 401 and stops before business code and the task store.
- The server's authorization layer Judges skill, action, data and OAuth scope from the authenticated identity and returns 403 when short; the mapping is defined by the implementation and documented.
- The task store and push configuration read paths Editorial advice: reads, lists, cancels, subscriptions and push configuration share one caller-scope condition; the official requirement is that a miss does not distinguish "does not exist" from "not authorized".
When to use
- You are exposing an A2A service whose Agent Card declares
securitySchemesand several skills, tasks are stored per caller, and you need a server entrance checklist. - You are chasing problems such as "someone else's task can be read or its existence inferred", "401 and 403 used the wrong way round", or "an action ran straight after
TASK_STATE_AUTH_REQUIRED", and you want the strength of each official requirement side by side.
When not to use
- You are writing an A2A client and want to know how to discover requirements, obtain credentials and send them. This article takes the server side; credential acquisition on the client side is an out-of-band process in the official pages and is not covered here.
- You want a concrete OAuth flow, a token validation library or the authentication extension points of a particular SDK. Neither page specifies these, and this article does not fill them in.
Four checks at the server entrance
Think of an inbound request as passing four checks in order. If one fails, you stop there and nothing after it runs. The order has a source: spec §7.5 opens with "Once authenticated", so authorization comes after authentication, and §13.1 requires authorization checks to happen before any database query that could leak whether a resource exists. The official wording uses different strengths (MUST, SHOULD, MAY), and the table keeps them apart.
| Check | Official requirement (spec section and strength) | On failure |
|---|---|---|
| Check 1: authentication | §7.4: the server MUST authenticate every incoming request based on the provided credentials and its declared authentication requirements; it SHOULD use binding-specific error codes and SHOULD provide authentication challenge information. The enterprise page also says the server must authenticate every incoming request | HTTP 401 or gRPC UNAUTHENTICATED; stop, so neither business code nor the task store runs |
| Check 2: operation authorization | §7.5: authorize based on the authenticated identity and the server's own policies; the logic is implementation-specific and MAY consider the requested skill, actions within tasks, data access policies and OAuth scopes. §13.1: servers MUST implement authorization checks on every operation request | HTTP 403 or gRPC PERMISSION_DENIED; stop, the operation does not start |
| Check 3: resource scope | §13.1: listing MUST return only tasks within the caller's authorized boundary, and get, cancel, subscribe and push-config operations MUST verify the caller's access. §3.3.2: an inaccessible resource is treated as not found | 404 / NOT_FOUND / TaskNotFoundError; stop, no task content is returned |
| Check 4: in-task authorization | §7.6.4: agents MUST NOT treat the transition to TASK_STATE_AUTH_REQUIRED as authorization for any operation; a credential or decision obtained in that state MUST NOT be assumed to cover later messages unless the implementation, the issuer or an extension explicitly defines it | While no valid authorization exists, the protected action does not run and the task stays in TASK_STATE_AUTH_REQUIRED (editorial expectation); the pages give no dedicated error code |
Each section below covers one check, and a made-up set of calls at the end ties the four together. Operation names follow spec section 3 (GetTask, ListTasks, CancelTask and so on). Paths and method names differ across the three bindings, and spec sections 9 to 11 list them.
Where identity comes from and what the card declares
The enterprise page says A2A payloads (JSON-RPC messages, for example) do not carry user or client identity directly; identity is established at the transport (HTTP) layer. Spec §7.3 likewise has the client put credentials in protocol-appropriate headers or metadata on every request. So a server can only derive the caller's identity from validated credentials. Editorial advice: tenant, contextId and metadata in the request body are filled in by the caller, so do not use them as identity. The spec describes tenant only as an opaque routing identifier and does not call it an authorization boundary.
A server publishes its authentication requirements in the Agent Card: card-level securitySchemes (a map from name to scheme) and securityRequirements (requirements for contacting the agent), plus a securityRequirements field on each skill (the security schemes that skill needs). The card excerpt below is a made-up illustration whose shape follows the OpenID Connect scheme and securityRequirements in the spec's §8.5 sample card; it omits version, capabilities and other required fields.
{
"name": "Trip Planner Agent",
"supportedInterfaces": [
{"url": "https://trip.example.com/a2a/json", "protocolBinding": "HTTP+JSON", "protocolVersion": "1.0"}
],
"securitySchemes": {
"corp": {
"openIdConnectSecurityScheme": {
"openIdConnectUrl": "https://idp.example.com/.well-known/openid-configuration"
}
}
},
"securityRequirements": [{ "schemes": { "corp": { "list": ["openid"] } } }],
"skills": [
{
"id": "route-optimizer",
"name": "Route Optimizer",
"description": "Plans routes between locations.",
"tags": ["routing"],
"securityRequirements": [{ "schemes": { "corp": { "list": ["routes:read"] } } }]
},
{
"id": "map-generator",
"name": "Map Generator",
"description": "Creates custom map images.",
"tags": ["maps"],
"securityRequirements": [{ "schemes": { "corp": { "list": ["maps:write"] } } }]
}
]
}Three wording issues to watch. The enterprise page says the card describes authentication schemes in a security field, while the spec data model uses securitySchemes and securityRequirements; implement the spec's field names. The spec does not define the structure of SecurityRequirement separately, and schemes plus list in the sample card is the only form that appears. How values in list map to OAuth scopes, and how card-level and skill-level requirements combine, is not stated on either page; the implementation defines it and, per §13.1, should document it. Third, the §6.9 example fetches the public Agent Card without an Authorization header, but the pages do not say whether the "authenticate every request" rule in §7.4 covers that fetch.
Check 1: authenticate every request
Spec §7.4 gives the server three rules: it MUST authenticate every incoming request based on the provided credentials and its declared authentication requirements; it SHOULD use binding-specific error codes for authentication challenges or rejections; and it SHOULD include relevant authentication challenge information in error responses. §3.3.2 files missing or invalid credentials under authentication errors, says servers MUST reject them, and gives HTTP 401 Unauthorized, gRPC UNAUTHENTICATED and a JSON-RPC custom error as example codes. The enterprise page adds the HTTP side: when credentials are missing or invalid, return 401, and the response should carry a WWW-Authenticate header telling the client which authentication methods are supported.
- Validate credentials on every request, including streaming subscriptions and task reads. Spec §7.3 says the client sends credentials on every A2A request and §7.4 says the server authenticates every request; read literally, there is no exception for a connection that was already validated.
- Editorial advice: treat missing, expired, rejected, or mismatched credentials (relative to the schemes the card declares) as authentication failures: return 401 and use
WWW-Authenticateto name the schemes the server accepts. The pages do not specify the header's contents (scheme name, realm, scope and so on). - Editorial advice: stop immediately after an authentication failure. Do not parse business parameters, query the task store or create a task, and put nothing about a specific task or skill in the 401 response.
- Log authentication failures and rate-limit them (§13.4: agents SHOULD log authentication failures and implement rate limiting to prevent brute-force attacks; it also recommends rate limiting on all operations). §13.4 also says credentials MUST be treated as secrets, so the editorial advice is to log the outcome and a request identifier, never the credential itself.
- Transport encryption: production deployments MUST use encrypted communication, HTTPS for HTTP-based bindings and TLS for gRPC (§7.1). The two pages disagree on the TLS version they recommend: the spec recommends 1.3 or higher, the enterprise page says 1.2 or higher. The deployer picks.
This is where 401 and 403 divide: 401 means the server could not establish who the caller is. If identity is established but permission is missing, that is the 403 in the next section.
Check 2: authorize by skill, action, data and scope
Authorization in §7.5 happens after authentication, based on the authenticated identity and the server's own policies. The spec says the logic is implementation-specific and lists four inputs with MAY: the specific skills requested, the actions attempted within tasks, data access policies, and OAuth scopes (if applicable). The enterprise page is more concrete, in plain-English should and must: skill-based authorization (certain OAuth scopes should allow invoking some skills but not others), data and action-level authorization (an agent that touches backend systems, databases or tools must enforce authorization before sensitive actions or data access, and acts as a gatekeeper), and least privilege (grant only the permissions needed for the intended operations).
| Input | What is checked | Data the decision needs | When insufficient |
|---|---|---|---|
| Skill | Whether the caller may use the skill the request targets; the skill-level securityRequirements in the card is the requirement published to clients | Which skill the request lands on. The pages do not define how a request names a skill: SendMessageRequest has only tenant, message, configuration and metadata, and the spec calls skills largely a descriptive concept | 403, operation does not start |
| Action | The specific action within a task: send a message, cancel, subscribe, configure push | The mapping from caller permissions to actions, defined by the implementation | 403 |
| Data | Backend data and tools the agent touches on the caller's behalf | Data access policy; the enterprise page requires authorization before sensitive data access or sensitive actions | Stop that action; when the caller must supply more authorization, TASK_STATE_AUTH_REQUIRED is available (see below) |
| OAuth scope | Whether the scopes in the token cover the skill or action | The scope set obtained after validating the token; scope names and their mapping to skills and actions are not specified by the pages | 403, and the response may name the missing permission or scope |
On 403: when an authenticated client lacks the required permissions, the spec says the server MUST return an authorization error (§3.3.2; example codes HTTP 403 Forbidden, gRPC PERMISSION_DENIED, a JSON-RPC custom error). It SHOULD indicate which permission or scope is missing, but MUST NOT reveal the existence of resources the client is not authorized to access. The enterprise page defines it as: the credentials are valid, but the authenticated client has no permission to perform the requested action.
Editorial advice: run the coarse checks that need only the credential first. If the token has no tasks:cancel scope at all, for example, return 403 right away without touching the task store, so the 403 carries no resource information. Checks that need a task read (who owns it, which skill it uses) belong to the next check: look the task up by ownership first, return 404 if nothing is found, and only then test the scope for that skill.
Check 3: one scope filter for task reads and lists
§13.1 requires implementations to limit results to the caller's authorization boundary even when the request carries no contextId or other filter. The agent's own authorization model defines the boundary; the spec lists user identity, organizational roles or groups, project or workspace membership, and organizational or tenant boundaries, and allows custom logic. The protocol does not prescribe the boundary, but agents SHOULD document their authorization model and access policies. Editorial advice: in storage terms, each task record can carry a boundary field (owner, tenant, project or similar), and every read path can share one scope condition. The spec only requires results to stay within the caller's authorized boundary; it does not prescribe a storage layout or a shared query interface.
| Operation | Official basis | Scope check | On a miss |
|---|---|---|---|
GetTask | §3.1.3: TaskNotFoundError means the task ID does not exist or is not accessible; §13.1: MUST verify access | Task ID plus the caller's boundary | TaskNotFoundError |
ListTasks | §3.1.4 and §13.1: return only tasks visible to the authenticated client | Restrict the candidate set to the caller's boundary first, then apply contextId, status, statusTimestampAfter and other filters | No error; an empty list when no task is visible |
CancelTask | §3.1.5: TaskNotFoundError means not found or not accessible; §13.1 | Same as GetTask, and before the state check behind TaskNotCancelableError | TaskNotFoundError |
SubscribeToTask | §3.1.6: TaskNotFoundError means not found or not accessible; §13.1 | Same as GetTask, and before the terminal-state check (a terminal task gets UnsupportedOperationError) | TaskNotFoundError |
| Push config create, get, list, delete | §3.1.7 to §3.1.10; §13.1 lists push configuration operations among those that MUST verify access | Check by task ownership; a configuration follows the boundary of its task (editorial advice) | TaskNotFoundError. The get-config error line says only "configuration does not exist" while its behavior text says the operation MUST fail if the configuration does not exist or the client lacks access; the delete error line says only "task ID does not exist". Neither says how an inaccessible resource is reported, so §3.3.2 and §13.1 still govern |
SendMessage with a taskId | §3.4.2: referencing a task that does not exist MUST return TaskNotFoundError; §13.1: authorization check on every operation request | Same as GetTask; when the caller supplies a contextId, include it in the boundary check (editorial advice) | TaskNotFoundError |
Four places the table does not cover are easy to miss when implementing; all four are editorial advice. 1) totalSize: the pages define it as the total number of tasks available before pagination and do not say for whom; count only the set the caller can see, otherwise the total itself leaks how many tasks others have. 2) pageToken: the pages do not say whether a token is bound to the caller; reapply the scope condition on every page rather than filtering only on the first. 3) Order of state checks: the TaskNotCancelableError from cancelling a terminal task, and the UnsupportedOperationError from subscribing to one or sending it a message, may only be returned after the ownership check passes; otherwise, for someone else's task, those two errors themselves show that the task exists. 4) Client side: an empty list only shows that the caller can see no tasks; it does not prove the server has none.
§13.1 also requires authorization checks to occur before any database query or operation that could leak the existence of resources outside the caller's scope. Editorial advice: putting the boundary into the query condition, so that the ID and the owner field match in one predicate, is the most direct way to meet this; fetching by ID first and comparing the owner afterwards means you have to argue that the query itself leaks nothing. The pseudo-code below lays the first three checks in order; store.get_task takes the boundary as a parameter, and list_tasks takes the same boundary.
# Pseudo-code, not a real SDK: editorial sketch of the check order
def handle(request):
principal = authenticate(request.headers) # credentials checked on every request
if principal is None:
return reject(401, header="WWW-Authenticate") # stop: no handler, no store access
operation = parse(request) # method, task id, params
if not policy.allows(principal, operation): # skill, action, data, OAuth scope
return reject(403) # stop: operation not started
task = None
if operation.task_id:
task = store.get_task(operation.task_id, boundary=principal.boundary)
if task is None: # missing and not-yours look the same
return reject(404, error="TaskNotFoundError")
if not policy.allows_task(principal, task): # e.g. skill scope of this task
return reject(403)
if operation.name == "ListTasks":
return store.list_tasks(operation.filters, boundary=principal.boundary)
return run(operation, task) # protected steps re-check their own grantWhat to read in this code: with failed authentication it returns before parse; 403 appears in two places, before any task query (coarse) and after the task is found (the scope for this task's skill); 404 comes only from a miss in the boundary-scoped query and does not separate "task does not exist" from "task belongs to someone else"; ListTasks goes through the same boundary parameter. policy.allows and policy.allows_task are placeholder names, not interfaces in the spec.
Check 4: AUTH_REQUIRED is not authorization
§7.6 covers the case where a task in progress needs extra authorization, for example when the agent needs an OAuth access token to call another API, or human approval for a destructive action. A2A lets the agent hand the fulfilment to the client: the agent MUST use a Task to track the operation, MUST move the state to TASK_STATE_AUTH_REQUIRED, MUST include a TaskStatus message explaining the required authorization (unless the details were negotiated out-of-band or by extension), and MUST arrange to receive credentials out-of-band (unless an in-band mechanism was negotiated out-of-band or via an extension). If the credential is received out-of-band, the agent SHOULD keep any active response streams with the client open after setting the state to TASK_STATE_AUTH_REQUIRED, which covers the time spent waiting for the authorization; once the credential arrives, the agent MAY continue processing immediately without a follow-up message from the client. The agent also SHOULD accept messages directed to the Task in this state so the client can negotiate, correct or reject the request (§7.6.1).
The credential channel has requirements too: agents SHOULD receive credentials out-of-band over a secure channel such as HTTPS, because in-band exchange can pass credentials through every participant in a chain of agents (§7.6.3). If in-band exchange is negotiated, the spec recommends binding credentials to the originating agent and making sensitive content readable only by it (both SHOULD).
§7.6.4 answers directly whether AUTH_REQUIRED counts as authorization. The protocol does not define the scope, representation, validity or revocation semantics of the authorization decision or credential obtained in response to this state. Agents MUST NOT treat the transition to TASK_STATE_AUTH_REQUIRED, by itself, as authorization for any particular operation; the meaning and scope of any resulting decision or credential MUST be defined by the agent's implementation, the credential issuer or an A2A extension. If an implementation requires authorization for specific operations, it is responsible for defining how the authorized operation is identified and how the authorization is checked before the operation runs. Also, a credential or decision obtained in this state MUST NOT be assumed to authorize subsequent messages on the Task unless the implementation, issuer or extension explicitly defines that. On the server side you could do the following, all editorial advice:
- Record authorization as an entry tied to an operation, with at least the caller, the task, the specific operation and an expiry; check it at the moment the protected action actually runs, not when a message arrives and not at the state transition.
- The task still belongs to the original caller's boundary. Whoever supplies a credential out-of-band (a user clicking approve on a consent page, say) does not thereby gain read access to this task.
- Later messages on the task still go through the first three checks: authentication, authorization, ownership. Do not reject them all, because the spec wants clients to be able to negotiate, correct or reject the request through them; but such a message does not turn the blocked action into an authorized one.
- Editorial expectation: while no valid additional authorization exists, the task stays in
TASK_STATE_AUTH_REQUIREDuntil the implementation's own check passes; the pages do not specify a response code for messages in the meantime, or when the task returns toTASK_STATE_WORKING.
One more wrinkle: the pages name this state two ways. The state table in §4.1.3 says authentication is required, while §7.6 speaks throughout of authorization. This article follows the authorization reading of §7.6 and does not infer that the two must be one mechanism in an implementation.
Four cases: what to return and where to stop
First, a tension inside the spec. The authorization-error entry in §3.3.2 lists "attempting to access a task created by another user" as an example scenario, with 403 as the example code; the resource-error entry in the same section says that when a resource does not exist or is not accessible to the authenticated client, the server MUST return not found and SHOULD NOT distinguish "does not exist" from "not authorized"; and the authorization-error entry also says servers MUST NOT reveal the existence of resources the client is not authorized to access. The error descriptions for GetTask, CancelTask and SubscribeToTask likewise say TaskNotFoundError means the task ID does not exist or is not accessible. Editorial advice: for reads addressed by task ID, take the "not found" path; keep 403 for cases that reveal no existence, meaning insufficient skill, action or scope that can be judged from the credential alone.
| Case | HTTP | gRPC | JSON-RPC | Stop action |
|---|---|---|---|---|
| Authentication failure (missing or invalid credentials) | 401, with WWW-Authenticate (enterprise page: should) | UNAUTHENTICATED | Custom error; the pages give no specific code | Do not parse business parameters, query the task store or create a task; log the failure without the credential |
| Insufficient authorization (skill, action or scope) | 403 | PERMISSION_DENIED | Custom error; the pages give no specific code | Do not start the operation; may name the missing permission or scope, reveals nothing the caller cannot see |
Reading someone else's task (GetTask, cancel, subscribe, push config and so on) | 404 | NOT_FOUND | -32001 (TaskNotFoundError) | Same response as for a task that does not exist; return no task content and run no state check |
A later message after TASK_STATE_AUTH_REQUIRED | No dedicated code defined on the pages | No dedicated code defined on the pages | No dedicated code defined on the pages | Authenticate, authorize and apply the ownership filter as usual; editorial expectation: while no valid additional authorization exists, the task stays in TASK_STATE_AUTH_REQUIRED and the blocked action runs only after the implementation's own check passes. The result differs if an out-of-band credential has arrived or the implementation, issuer or an extension defines otherwise (§7.6.1, §7.6.4) |
The mapping comes from the example codes in §3.3.2 and the error code table in §5.4: TaskNotFoundError is -32001 in JSON-RPC, NOT_FOUND in gRPC and 404 Not Found in HTTP. The §5.4 table has no authentication or authorization errors, so JSON-RPC codes for 401-type and 403-type errors are not in the spec's mapping; the range used for A2A-specific errors is -32001 to -32099 (§9.5). The fourth row has no dedicated code because the pages do not define one: the spec forbids treating the transition into that state, by itself, as authorization. In-band credential exchange and authorization semantics for later messages have explicit exceptions: when negotiated out-of-band or via an extension, or when the implementation, the credential issuer or an extension defines them (§7.6.1, §7.6.4). The pages do not say what response a later message gets.
Made-up walk-through: one trip-planner request set
What follows is worked by hand, not output from a real run. Imagine a trip-planner agent whose card, as in the excerpt above, declares two skills: route-optimizer needs routes:read and map-generator needs maps:write. The server's task store holds three tasks, and the owner is the caller identity obtained after authentication.
| Task | Owner | Skill | State |
|---|---|---|---|
task-100 | alice | route-optimizer | TASK_STATE_COMPLETED |
task-101 | alice | map-generator | TASK_STATE_AUTH_REQUIRED |
task-200 | bob | route-optimizer | TASK_STATE_WORKING |
| Request | Check reached | Result and stop action |
|---|---|---|
Read task-100 with no credentials | Authentication | 401 with WWW-Authenticate; the store is not queried |
alice's token holds only routes:read; she creates a new map-generator task | Operation authorization | 403, naming the missing maps:write; no task is created |
bob reads task-100 | Resource scope | 404 TaskNotFoundError, the same shape as reading a nonexistent task-999 |
bob cancels task-100 (already terminal) | Resource scope | 404 TaskNotFoundError; no TaskNotCancelableError appears |
alice calls ListTasks | Resource scope | Only task-100 and task-101, totalSize is 2, no task-200 |
alice, with a token that includes maps:write, sends task-101 a message saying which account she wants to use | All three checks pass (the token passes operation authorization and the task is hers), then in-task authorization | The message is accepted and used to negotiate authorization; no valid additional authorization exists yet, so the task is still TASK_STATE_AUTH_REQUIRED (editorial expectation), and the action that calls the external account waits until the implementation's own authorization record exists |
Note rows 3 and 4: bob's response must not let him tell whether task-100 does not exist or belongs to someone else, and must not give him a different error just because task-100 is already terminal. In row 5, bob's task does not appear in alice's list and does not count toward her totalSize. In row 6, alice's message is accepted on two conditions: the task is hers and she is authenticated, and her token includes the maps:write that this skill needs. If you reuse the token from row 2, which holds only routes:read, this article's policy.allows_task returns 403 for the missing maps:write; the article defines no special permission policy for negotiation messages. Acceptance also does not automatically authorize an external action such as a calendar call.
Server entrance checklist
This checklist is the deliverable of the article, ordered the way a request enters the server. Each item is written so you can answer "done or not", and each opens by saying whether its basis is an official requirement or editorial advice.
- Official requirement: every request (subscriptions and reads included) is authenticated first (§7.4 MUST). Official recommendation: an authentication failure uses the binding-specific code, which is 401 (HTTP) or
UNAUTHENTICATED(gRPC), and the HTTP response carriesWWW-Authenticate(§7.4 SHOULD, enterprise page should). Processing stops after an authentication failure. - Editorial advice: business parameters are parsed only after credentials validate;
tenant,contextIdandmetadatain the body are not treated as identity. - Official recommendation (§13.1: agents SHOULD document their authorization model): the mapping from skills, actions, data and OAuth scopes to permissions is documented, including how a request lands on a given skill (the spec does not define this).
- Official requirement: missing permission returns an authorization error (403 or
PERMISSION_DENIED). Editorial advice: when it can be judged from the credential alone, do not touch the task store, and the response may name the missing scope. - Official requirement: every task operation is limited to the caller's authorized boundary (§13.1). Editorial advice: all operations by task ID and
ListTasksshare one scope condition, with no read path that bypasses it, including cancel, subscribe, push config and send-message with ataskId. - Official requirement (§3.3.2: servers SHOULD NOT distinguish): a task the caller cannot see gets the same response as a task that does not exist: 404,
NOT_FOUNDorTaskNotFoundError. - Official requirement:
ListTasksreturns only tasks the caller can see. Editorial advice:totalSizeand every page behind a page token stay within that set too. - Editorial advice: state checks such as terminal or cancelable come after the ownership check.
- Official requirement: entering
TASK_STATE_AUTH_REQUIREDis not, by itself, authorization for any operation. Editorial advice: an authorization record binds caller, task, specific operation and expiry, and is checked when the protected action runs (the spec does not define the representation or validity of an authorization). - Official recommendation (§13.4: agents SHOULD log authentication failures and authorization denials); editorial advice: the logs contain no credentials.
Self-test: five requests
In your own test environment, the five requests below let you check the first three checks. The commands target the HTTP+JSON binding, with paths taken from spec §11.3; the spec page does not spell out how those paths attach to the interface URL in the Agent Card, so adjust to your deployment. The A2A-Version header goes on every request, as §3.6.1 requires. The tokens are test tokens for alice and bob in your own environment; do not use real accounts.
BASE="https://trip.example.com/a2a/json" # your interface url; adjust paths to your deployment
# 1: no credentials
curl -i -H "A2A-Version: 1.0" "$BASE/tasks/task-100"
# 2: valid token without cancel permission, cancelling alice's own task
curl -i -X POST -H "A2A-Version: 1.0" -H "Authorization: Bearer $TOKEN_ALICE_NO_CANCEL" "$BASE/tasks/task-101:cancel"
# 3: bob reads alice's task
curl -i -H "A2A-Version: 1.0" -H "Authorization: Bearer $TOKEN_BOB" "$BASE/tasks/task-100"
# 4: bob reads a task that does not exist
curl -i -H "A2A-Version: 1.0" -H "Authorization: Bearer $TOKEN_BOB" "$BASE/tasks/task-does-not-exist"
# 5: alice lists her tasks
curl -i -H "A2A-Version: 1.0" -H "Authorization: Bearer $TOKEN_ALICE" "$BASE/tasks?pageSize=50"- Request 1 has no credentials; expect status 401 and a
WWW-Authenticateheader. - Request 2 checks check 2: the token is valid (authentication passes) but lacks cancel permission, and it cancels alice's own
task-101. Expect 403, an unchanged task state, and optionally a named missing permission or scope. IssueTOKEN_ALICE_NO_CANCELunder your own policy so that it really lacks the cancel permission. - Requests 3 and 4 check check 3: bob's token already passes operation authorization for reading tasks, so the result depends only on the ownership filter. Compare the status code,
error.status(NOT_FOUNDunder the HTTP binding) and thereasonof theErrorInfoobject inerror.details[]: bob reading alice's task and bob reading a nonexistent task should look the same; expect 404 andTASK_NOT_FOUNDfor both. ThetaskIdandtimestampin the error details vary per request and need not match. - Request 5 uses alice's token: every task returned belongs to alice and
totalSizeequals her own task count.pageSizeis only a per-page upper bound and the server may return fewer tasks, so judge whether you have the last page bynextPageToken: an empty string means no more results; the spec requires the field to be always present, so a missing field is a non-compliant response (§3.1.4). - The AUTH_REQUIRED case needs the task to reach that state first, then a message sent to it before any additional authorization is provided; produce that in whatever way your implementation allows. Editorial expectation: the task is still
TASK_STATE_AUTH_REQUIREDand the protected action did not run. If your implementation, issuer or an extension defines messages as able to carry authorization, or an out-of-band credential has arrived, the result differs (§7.6.1, §7.6.4).
What the official pages do not state, and what was checked
- The specific error codes for authentication and authorization errors under the JSON-RPC binding: §3.3.2 says only "JSON-RPC custom error", and the §5.4 mapping table has neither.
- The contents of the
WWW-Authenticateheader: the enterprise page says only that the response should carry it, without scheme names, realm or scope parameters. - How a request names the skill to use, and how the server maps a request to a skill in the card.
- The full structure of
SecurityRequirement, howlistcorresponds to OAuth scopes, and how card-level and skill-level requirements combine. - Whether fetching the public Agent Card is also subject to the authentication rule in §7.4.
- Whether
totalSizeandpageTokenare computed and bound per caller scope. - The scope, validity and revocation of credentials after
TASK_STATE_AUTH_REQUIRED, and the response code for messages in the meantime; the spec explicitly leaves these to the implementation, issuer or extensions. - The rate-limit response code: §13.4 recommends rate limiting on all operations and appropriate error responses when limits are exceeded, but names no response code and not 429; §3.3.2 lists "rate limit exceeded" as a system-error scenario with example codes 500 or 503.
- Version: this article follows the Latest Released Version 1.0.0 shown on the spec page; some examples on the spec page still show
A2A-Version: 0.3, so go by the version your target interface declares.
This article relies on the A2A specification page and the enterprise implementation page, both read on 2026-11-24. No A2A server or SDK was called in this batch, nothing was installed, and no request was run; the pseudo-code, the card excerpt, the made-up walk-through and the self-test commands were never run, and the results in them are worked out from the spec text. Sentences marked "editorial advice" are implementation choices, not official requirements. Before you build, check the authentication and authorization extension points in the documentation of the SDK or framework you actually use.
Sources
All links are official pages; verification dates are listed per source, and links point to the version checked.