Skip to content

A2A server: ask the client for tool approval via TASK_STATE_INPUT_REQUIRED instead of auto-denying #4970

In progress

Description

@deka

Overview

When an agent served with docker agent serve a2a makes a tool call that needs user approval, the call is silently auto-denied. The client is never asked, and the task still ends in COMPLETED.

I'd like the A2A server to use the protocol's TASK_STATE_INPUT_REQUIRED state instead, so the client can approve or reject the tool call.

Motivation

Today the only way to get useful work done over A2A is to auto-approve every tool, which is a safety trade-off users shouldn't be forced into. The TUI and serve api already support approvals, and A2A defines TASK_STATE_INPUT_REQUIRED for exactly this, but docker-agent never emits it.

Use cases

  1. An orchestrator delegates a task to a docker-agent over A2A and relays shell-command approval requests to its own user.
  2. A web front-end built on A2A shows an "Approve / Reject" prompt instead of the tool call being silently dropped.
  3. With push notifications, the client is notified that the task is waiting for approval and can answer asynchronously.

Proposed solution

  • When a tool call needs confirmation, the task moves to INPUT_REQUIRED. The status message describes the pending call.
  • The client approves or rejects it with a follow-up message on the same task, and the task resumes.
  • Opt-in behind a flag, so existing deployments keep the current behavior.

Related issues

Activity

  1. added
    area/a2a
    area/runtime
    on Nov 19, 2026
  2. deka commented on Nov 23, 2026

    @deka
    ContributorAuthor

    Addendum: normalizing the reply with an A2A extension

    Problem. A2A (1.0) has no "allowed responses" field for TASK_STATE_INPUT_REQUIRED. The A2A TSC decided this should be handled by an extension.

    Proposal. An extension …/a2a/tool-approval/v1 (URI to be decided), enabled only with --tool-approval.

    1. Declared in the AgentCard
    capabilities.extensions: [{
      uri: ".../tool-approval/v1",
      required: false              // clients unaware of it keep working
    }]
    1. Pause: the contract lives in the function_call part of status.message
    status: {
      state: INPUT_REQUIRED,
      message.parts: [{
        data: { id, name: "shell", args },
        metadata: {
          ".../tool-approval/v1": {
            prompt: "shell wants to run a command",
            responseSchema: {        // JSON Schema, readable by a UI and by an LLM
              decision: enum[approve, reject],
              reason?: string
            }
          }
        }
      }]
    }
    1. Client reply
    SendMessage {
      taskId, contextId,               // taskId is required
      extensions: [".../tool-approval/v1"],
      parts: [{ data: { id, name, response: { decision: "approve" } } }]
    }
    1. Invalid decision: the request is rejected and the task keeps waiting
    error: { code: -32602, data.reason: "decision 'x' not allowed; expected [approve, reject]" }
    // task stays INPUT_REQUIRED, nothing added to history, no push notification
  3. deka commented on Nov 24, 2026

    @deka
    ContributorAuthor

    Addendum: normalizing the reply with an A2A extension

    Problem. A2A (1.0) has no "allowed responses" field for TASK_STATE_INPUT_REQUIRED. The A2A TSC decided this should be handled by an extension.

    Proposal. An extension …/a2a/tool-approval/v1 (URI to be decided), enabled only with --tool-approval.

    1. Declared in the AgentCard

    capabilities.extensions: [{
    uri: ".../tool-approval/v1",
    required: false // clients unaware of it keep working
    }]
    2. Pause: the contract lives in the function_call part of status.message

    status: {
    state: INPUT_REQUIRED,
    message.parts: [{
    data: { id, name: "shell", args },
    metadata: {
    ".../tool-approval/v1": {
    prompt: "shell wants to run a command",
    responseSchema: { // JSON Schema, readable by a UI and by an LLM
    decision: enum[approve, reject],
    reason?: string
    }
    }
    }
    }]
    }
    3. Client reply

    SendMessage {
    taskId, contextId, // taskId is required
    extensions: [".../tool-approval/v1"],
    parts: [{ data: { id, name, response: { decision: "approve" } } }]
    }
    4. Invalid decision: the request is rejected and the task keeps waiting

    error: { code: -32602, data.reason: "decision 'x' not allowed; expected [approve, reject]" }
    // task stays INPUT_REQUIRED, nothing added to history, no push notification

    @aheritier , @rumpl , @dgageot , Before starting development, can you confirm that this design is ok for you?
    To put it simply, the idea is to add an A2A extension to normalize INPUT_REQUIRED exchanges.

    If ok, we need extension uri like https://docker.github.io/docker-agent/features/a2a/extensions/tool-approval/v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/a2aarea/runtime

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions