Outcall
SpecificationsS004 · Agent API

S004 · Agent API

Specification module 004-agent-api

S004: Agent API

FieldValue
SpecS004
FeatureAgent API
Date2026-04-21
StatusDraft
Author@marktopper

Overview

The Agent API is the sole communication surface between AI agent containers and outcalld. It is served on a Unix domain socket (agent.sock) that is bind-mounted into each container. Through this socket, agents check in, request permission before executing tools or making network calls, submit rule requests for host operator approval, and query the status of those requests.

The Agent API enforces a strict trust boundary: containers see only verdicts and request acknowledgements. They never receive rule definitions, policy internals, host configuration, or any information about other containers. All rule evaluation happens host-side before any tool execution proceeds.

If the agent socket is unreachable, the outcall-agent shim exits with code 5 (fail closed). There is no fallback, no retry loop, and no degraded mode.

User Scenarios

S004-US-001 [P1] As an AI agent, I want to check in with outcalld so that I receive my container identity and policy context before doing any work.

S004-US-002 [P1] As an AI agent, I want to request permission before executing a tool so that outcalld can evaluate rules and return a verdict.

S004-US-003 [P1] As an AI agent, I want to request permission before making a network call so that outcalld can evaluate rules and return a verdict.

S004-US-004 [P2] As an AI agent, I want to submit a rule request so that a host operator can approve new capabilities for my container.

S004-US-005 [P2] As an AI agent, I want to query the status of a pending rule request so that I know whether to proceed or wait.

S004-US-006 [P1] As a host operator, I want the agent API to enforce a strict trust boundary so that agents cannot access host-side configuration or rule definitions.

Requirements Summary

IDTypePriorityTitleStatus
S004-FR-001FunctionalP1Socket created by outcalldDraft
S004-FR-002FunctionalP1Socket path conventionDraft
S004-FR-003FunctionalP1Socket lifecycle tied to daemonDraft
S004-FR-004FunctionalP1Agent check-in endpointDraft
S004-FR-005FunctionalP1Container identity verificationDraft
S004-FR-006FunctionalP1Permission request endpointDraft
S004-FR-007FunctionalP1Verdict response formatDraft
S004-FR-008FunctionalP1Host-side rule evaluationDraft
S004-FR-009FunctionalP1Fail-closed on unreachableDraft
S004-FR-010FunctionalP1No policy leakageDraft
S004-FR-011FunctionalP2Rule request submissionDraft
S004-FR-012FunctionalP2Rule request status queryDraft
S004-FR-013FunctionalP1Context variables with requestsDraft
S004-FR-014FunctionalP2Rate limitingDraft
S004-FR-015FunctionalP1Request timeout behaviorDraft
S004-FR-016FunctionalP1Structured loggingDraft
S004-FR-017FunctionalP1Typed errorsDraft
S004-FR-018FunctionalP1Tokio task integrationDraft
S004-FR-019FunctionalP1Separate from host APIDraft
S004-AS-001AcceptanceP1Check-in happy pathDraft
S004-AS-002AcceptanceP1Permission grantedDraft
S004-AS-003AcceptanceP1Permission deniedDraft
S004-AS-004AcceptanceP1Fail closed on socket missingDraft
S004-AS-005AcceptanceP1Fail closed on daemon crashDraft
S004-AS-006AcceptanceP2Rule request submittedDraft
S004-AS-007AcceptanceP2Rule request status polledDraft
S004-AS-008AcceptanceP1No cross-container leakageDraft
S004-AS-009AcceptanceP1Context variables forwardedDraft
S004-AS-010AcceptanceP2Rate limit enforcedDraft
S004-AS-011AcceptanceP1Request timeout respectedDraft
S004-IF-001InterfaceP1POST /v1/checkinDraft
S004-IF-002InterfaceP1POST /v1/permissions/checkDraft
S004-IF-003InterfaceP2POST /v1/requests/rulesDraft
S004-IF-004InterfaceP2GET /v1/requests/rules/{id}Draft
S004-IF-005InterfaceP1Error response formatDraft
S004-EC-001Edge CaseP1Socket missing at startupDraft
S004-EC-002Edge CaseP1Daemon crashes mid-requestDraft
S004-EC-003Edge CaseP1Malformed request bodyDraft
S004-EC-004Edge CaseP2Duplicate check-inDraft
S004-EC-005Edge CaseP1Unknown container IDDraft
S004-EC-006Edge CaseP2Rate limit exceededDraft
S004-EC-007Edge CaseP1Request timeout exceededDraft
S004-EC-008Edge CaseP1Host socket access attemptedDraft
S004-EC-009Edge CaseP2Rule request for existing ruleDraft
S004-EC-010Edge CaseP1Oversized request bodyDraft
S004-SC-001SuccessP1Agent completes check-inDraft
S004-SC-002SuccessP1Permission flow round-tripDraft
S004-SC-003SuccessP1Fail-closed verifiedDraft
S004-SC-004SuccessP1Trust boundary holdsDraft
S004-SC-005SuccessP2Rule request lifecycleDraft

Cross-Spec Dependencies

  • Depends on: S001 (bridge must be up; agent socket listens on bridge IP)
  • Depends on: S003 (rule evaluation happens host-side via the rule engine)
  • Required by: S005, S008

On this page