*.usehasp.run). Discovery is public; invocation is authenticated.
The AgentCaller (substrate model)
Every caller in the HASP system — human, API key, or agent — is classified for audit and policy. The agent caller type isAgentCaller (OAuth 2.1 + RAR–aligned credentials under delegated human authority per ADR-3RWY4P):
AgentCaller is distinguished by three properties that the others lack:
- Delegating user — the human whose authority the agent acts under. Audit liability flows here.
- Granted scopes — an explicit, bounded set of what the agent is authorized to do. Not “whatever seems right.”
- Delegation chain — when an agent delegates to another agent, the full chain of authority is captured and preserved.
Authentication for POST /a2a/...
The A2A route accepts either credential type as a bearer token:
acme.usehasp.run → org acme), and the caller must hold the workflow.run capability. An org API key gets it from the workflow:invoke or control:workflows scope; an agent credential gets it from a workflow.invoke grant. A credential whose grant names specific workflow_ids may invoke only those. Any failure is rejected with JSON-RPC -32002.
Issue and rotate agent credentials through the Agents API or Settings → Agent Access; create org API keys under Settings → API Keys. Invoke against the endpoint URL from /.well-known/agents.json (see below).
Prefer a delegated agent credential (
hasp_agt_*) for agent traffic: it carries the delegating user, an expiry, and a revocation handle, so the audit chain records who the agent acted for. An org API key carries none of that.AgentCaller credential shape (ADR-3RWY4P)
A credential issuance includes:
See Issuing credentials for the request/response shape and Revocation for kill vs. drain semantics.
Scope grants
Resource-action scope types describe the RAR-style grants attached to anAgentCaller credential — see Scope grants for the full grammar and constraint syntax.
Agent-callable workflows
In AI Studio, a workflow with audience Agent-callable can be listed in discovery and invoked via A2A. Author it in chat:“Create a workflow that can be invoked by an agent to look up a patient’s current status and return the summary.”When a client calls
POST /a2a/{project_slug}/{workflow_slug}, the platform:
- Resolves the bearer token to a caller, ensures its org matches the request’s org subdomain, and requires the
workflow.runcapability. - Resolves the workflow, then narrows against the credential’s granted
workflow_idsif it names any. - Runs policy, PHI guard, and audit as for other gateway executions.
- Dispatches the workflow run and returns a JSON-RPC result (or error).
Capability discovery
Public org-level discovery is served on your runtime host, not onapi.usehasp.com. No authentication is required.
CapabilityDiscoveryController): top-level org_id, org_slug, and an agents array of capability cards (not the older TypeSpec AgentsDiscoveryDocument sample shape). Illustrative example:
Cache-Control: public, max-age=300); send If-None-Match against the response ETag for conditional requests. Use each card’s endpoint as the JSON-RPC URL.
Invoking a workflow (JSON-RPC 2.0)
V1 contract: the JSON-RPCmethod must be the literal string "invoke". Workflow-specific names are not accepted as method (other values yield JSON-RPC -32601). Pass workflow inputs inside params.
Multi-agent delegation
Under the AgentCaller model, an agent can delegate to another agent for a sub-task. The delegating agent’s credential produces a child credential bounded by its own scopes. The delegation chain is preserved and audited.delegation_chain and emitted as a handoff event in the audit chain. agent.delegate carries a max_chain_depth (1–10); exceeding it fails with AGENT_DELEGATION_CHAIN_DEPTH_EXCEEDED.
Standards alignment
HASP’s agent identity layer aligns with:- OAuth 2.1 — delegated authorization for agent credentials
- Rich Authorization Requests (RAR) — structured scopes
- MCP authorization specification — agent-to-server patterns
AgentCaller credentials over org-wide API keys for sensitive agent flows.
Revoking access
Revoke an agent credential per issuance viaPOST /v1/agents/{agent_id}/credentials/{credential_id}/revoke or from Settings → Agent Access. Revocation supports kill (terminate in-flight runs) and drain (let in-flight runs finish, refuse new ones) — see Revocation.
Org API keys are rotated or revoked in Settings → API Keys. New invocations fail immediately with an invalid key; in-flight runs started before revocation complete normally.