Service APIs
APF exposes three local APIs. The OpenShell extension interfaces that the gateway also serves are covered in Adapter Contracts.
The protobuf definitions are in contracts/proto/nvidia/agent_policy_fabric/. Both Unix sockets have mode 0600 and accept only the UID set by --allowed-uid, which defaults to the service’s own UID.
PolicyService
Package nvidia.agent_policy_fabric.policy_service.v1alpha1, file policy_service/v1alpha1/policy_service.proto.
GetDocumentRequest
GetDocumentResponse
Field number 4 is unused. A comment in the contract marks it as reserved.
Surface Kinds
Status Codes
Policy Service HTTP API
Enable it with --http-addr and --http-bearer-token-file. Bind it to loopback unless you have a reason not to.
Send the token as Authorization: Bearer <token>.
Refresh
With the local source, POST /v1/refresh loads the bundle named in the JSON body and runs the full verification and counter checks:
The body is required. The service does not fall back to --bundle-path. With the HTTP source, bundle_path is ignored and the call triggers a poll. It returns 200 even when the poll fails, so confirm the outcome in the audit log.
Error Responses
Every refresh call that passes authentication and has an acceptable body writes policy.refresh_triggered before the refresh runs.
EvaluationService
Package nvidia.agent_policy_fabric.pdp.v1alpha1, file pdp/v1alpha1/pdp.proto. The gateway serves it on its Unix socket. It decides one request against the active policy set.
EvaluateRequest
The request has no body or target, so content controls that read body_text, body_json, or target.* see nothing.
EvaluateResponse
Effects are evaluated but not applied or returned, so an effect that reads a missing annotation still denies the request. DECISION_REQUIRE_REVIEW, DECISION_REQUIRE_STEP_UP, DECISION_QUARANTINE, and DECISION_STOP_SESSION are reserved and never returned.
An evaluator error returns INTERNAL with evaluator engine error: <detail> and writes no audit record. Every decision writes an authorization record to apf-policy-gateway-audit.jsonl.
RuntimeContext
Package nvidia.agent_policy_fabric.runtime.v1alpha1, file runtime/v1alpha1/runtime.proto. Shared by GetDocument and Evaluate.
Next Steps
- For the OpenShell interceptor and middleware interfaces, refer to Adapter Contracts.
- For the records these APIs write, refer to Audit Event Schema.