A2A Compatibility
Use this guide to make your agent compatible with Sekuire platform routing and delegation.
What Platform Routing Requires
For workspace A2A routing (/a2a/route) to work end-to-end, your agent must:
- Register capabilities that match routed skills.
- Expose a reachable task endpoint at
a2a.upstream_url. - Accept POST
/a2a/taskspayloads from the platform. - Return a structured task result (
status,result/output, orerror).
If discovery works but your task endpoint is missing, routing succeeds and task forwarding fails.
Declare Capabilities in sekuire.yml
sekuire.yml
capabilities:
provides:
- "chat"
- "summarize"
requires: []
a2a:
upstream_url: "http://localhost:8011/a2a/tasks"
Notes:
capabilities.providesis used for skill matching in platform routing.a2a.upstream_urlshould point to your tasks endpoint.sekuire run --capability ...can override manifest capabilities at runtime.
/a2a/tasks Request Contract
Platform forwarding sends a task payload like:
POST /a2a/tasks
{
"task_id": "8f4f1f17-7f12-4f6d-a6c4-5e1b4a6c9f4b",
"type": "summarize",
"input": {
"skill": "summarize",
"message": {
"role": "user",
"parts": [
{ "type": "text", "text": "Summarize this document" }
]
}
},
"context": {
"skill": "summarize",
"workspace_id": "ws_123",
"requester_id": "agent_router"
}
}
Your handler should tolerate slight shape variations (message as string/object, optional type, etc.).
/a2a/tasks Response Contract
Return 200 on success:
{
"task_id": "8f4f1f17-7f12-4f6d-a6c4-5e1b4a6c9f4b",
"status": "completed",
"result": {
"message": "Summary text..."
},
"output": {
"message": "Summary text..."
},
"execution_time_ms": 312
}
Return 4xx/5xx with structured error on failure:
{
"task_id": "8f4f1f17-7f12-4f6d-a6c4-5e1b4a6c9f4b",
"status": "failed",
"error": {
"code": "internal_error",
"message": "Provider timeout"
}
}
Fastify Example
import Fastify from "fastify";
const fastify = Fastify({ logger: true });
fastify.post("/a2a/tasks", async (request, reply) => {
const body = request.body as {
task_id?: string;
type?: string;
input?: unknown;
context?: Record<string, unknown>;
};
const taskId = body.task_id ?? `task_${Date.now()}`;
try {
// Execute your capability here
const result = { message: "ok" };
return {
task_id: taskId,
status: "completed",
result,
output: result,
};
} catch (error) {
reply.code(500);
return {
task_id: taskId,
status: "failed",
error: {
code: "internal_error",
message: error instanceof Error ? error.message : "Unknown error",
},
};
}
});
Signed Request Enforcement (Recommended)
If you use SDK request verification, include /a2a/tasks in protected paths:
fastify.addHook(
"preHandler",
createSekuireFastifyRequestAuthHook(sekuireServer, {
protectedPaths: ["/chat", "/webhook", "/a2a/tasks"],
}),
);
Validation Checklist
POST /a2a/tasksreturns non-404.- Capability names in
capabilities.providesmatch routed skill strings. a2a.upstream_urlpoints to the live task endpoint.- Successful calls return
status: "completed"andresult/output. - Failures return
status: "failed"with anerrorobject.