[Feat]: Add a PermissionDenied server error with HTTP 403 and gRPC PERMISSION_DENIED mappings
Maintainers usually reply within 2 days
@Iwaniukooo11 is already working on this.
Since Nov 2, 2026.
Assessment
This issue has not been assessed yet.
Description
Feature request
Please expose a server-side PermissionDeniedError (or equivalent generic authorization error) with consistent transport mappings. With a2a-sdk==1.3.0, a2a.utils.errors has no authorization-denial type and A2A_ERROR_MAPPING has no HTTP 403 / gRPC PERMISSION_DENIED mapping.
Why this is needed
An authenticated client can lack the action permission to list or cancel tasks even though the agent supports the operation and the task is still cancelable. Raising UnsupportedOperationError or TaskNotCancelableError misrepresents the failure and can cause a client to cache the wrong capability or lifecycle conclusion.
A2A v1.0.1 §3.3.2 requires authorization errors for insufficient permissions. It gives HTTP 403, gRPC PERMISSION_DENIED and a JSON-RPC custom error as examples. Resource hiding remains a separate concern: inaccessible or nonexistent task IDs should still be indistinguishable via TaskNotFound where appropriate.
Reproduction / API gap
import a2a.utils.errors as errors
assert not hasattr(errors, "PermissionDeniedError")
assert not any(mapping.http_code == 403 or mapping.grpc_status == "PERMISSION_DENIED"
for mapping in errors.A2A_ERROR_MAPPING.values())
This passes with 1.3.0. A handler wishing to deny an authenticated caller's ListTasks or CancelTask action cannot raise a built-in exception with the required authorization semantics.
Requested behavior
- A public server exception representing an action-policy denial.
- HTTP/REST 403 and gRPC PERMISSION_DENIED mappings.
- An SDK-owned JSON-RPC custom error mapping (rather than applications inventing conflicting numeric codes).
- Structured
google.rpc.ErrorInfowith a documented stable reason such as PERMISSION_DENIED, plus optional bounded missing-scope information. - Client-side reconstruction and transport regression tests.
- Documentation distinguishing action denial from resource existence hiding, unsupported operations, and noncancelable lifecycle states.
Our HTTP teaching lab now authorizes in identity middleware and returns HTTP 403 before dispatch, which works around the HTTP gap. A shared handler-level exception would make this practical across JSON-RPC, HTTP+JSON and gRPC without separate application mappings.
I searched for PermissionDenied, PERMISSION_DENIED, and authorization-error reports before filing; this request is scoped to the missing public server error/mappings in 1.3.0.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 540
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 56
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from a2aproject/a2a-python
-
[Bug]: `A2A-Version` validation ignores minor versions and the query parameterPossibly taken @rohityan claimed this 82 days ago. Opencomponent: server status:awaiting response status:stale
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
a2aproject/a2a-python#1204 · 4 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
[Bug]: REST task/request id sanitizationMay be free again A pull request for this issue was closed without being merged. Openmaintainers-only
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a2aproject/a2a-python#805 · 1 comment ·
Maintainers usually reply within 2 days
-
[Bug]: JSON-RPC client ignores the JSON-RPC error body when the HTTP status is not 2xxPossibly taken @rohityan claimed this today. Open
a2aproject/a2a-python#1475 · 2 assignees ·
Maintainers usually reply within 2 days
-
[Feat]: validate_input_modes: match media ranges such as image/* declared in the agent cardPossibly taken @rohityan claimed this 2 days ago. Open
a2aproject/a2a-python#1468 · 2 assignees ·
Maintainers usually reply within 2 days
-
Required extensions aren't enforced, so ExtensionSupportRequiredError is never raisedPossibly taken @rohityan claimed this 2 days ago. Opencomponent: server status:awaiting response
a2aproject/a2a-python#1467 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
All issues in a2aproject/a2a-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Install the skills as a Claude Code pluginPossibly taken @ruban-24 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
FAIRmat-NFDI/pynxtools#874 ·
-
Eval: PublicationOpendata
Difficulty 2/5 1-3 hours Newbie friendliness 66/100