Error Reference
This page lists every code APF writes to its audit records or returns to a caller on the main branch. Search it for the code you see. For a diagnostic workflow, refer to Troubleshooting and Investigate a Denied Request.
Policy Service Startup
Written once per start as policy_service_startup. The first weakened control becomes the reason_code, and error.message lists all of them.
These failures stop the policy service. The message is printed on standard error. The first four occur before the startup record is written, so they leave no audit record. The others occur after it.
Bundle Rejection Reasons
A rejected bundle produces a policy_verification record with outcome refused, reason_code policy.bundle_rejected.<first reason>, the reason codes in rejection_reasons, and the full detail in error.message. With the HTTP source, the policy service picks the manifest from the archive by trying each .yaml file until one verifies and parses. If none does, for example because the signature is invalid or the signing key is not trusted, it never reaches the verification step: no policy_verification record is written, and the only message is find bundle manifest: no bundle manifest (.yaml) found in extracted archive at <path> in the service log. The same text appears in apf-compile errors and in POST /v1/refresh responses.
Signature Details
Policy Service Records
Activation
A bundle that verifies but fails to load its members or compile produces no activation record. The refresh response or the service log carries the error, such as compile bundle: ....
Documents and Refresh
Authentication
Gateway Records
If the gateway cannot fetch, decode, or build a new policy set, it logs get_document failed on hot-swap, PolicySet decode failed on hot-swap, or evaluator rebuild failed, keeps its current evaluator, and writes no record. At startup the same failures stop the gateway, with fetch apf.policy.v1 PolicySet, decode PolicySet, or build initial Cedar evaluator followed by the cause, for example build Cedar evaluator: evaluator engine error: rule '<name>': policy parse: ....
Interceptor Records
The interceptor answers OpenShell with allowed: false and the reason in the table. OpenShell refuses the operation.
Sandbox Creation
Infrastructure failures return a gRPC status instead and write no record: INVALID_ARGUMENT with operation missing name (sandbox_id), UNAVAILABLE with policy service unavailable: ..., or INTERNAL with patch generation failed: .... The last two also apply to configuration refreshes.
Configuration Changes
Providers and Proposals
Other Interceptor RPCs
These return a gRPC status and write no record.
Middleware Records
The middleware returns a deny’s code to OpenShell without the middleware. prefix and records it with the prefix. An allow carries an empty code on the wire. middleware.allowed and middleware.allowed_with_findings appear only in audit records. A Describe protocol mismatch and WebSocket sessions return gRPC statuses, and a non-empty configuration makes ValidateConfig answer valid: false with configuration must be empty; received <n> field(s). None of these writes a decision record. Caller authentication failures on any RPC write extension_auth.* records.
Authentication Records
Written by the interceptor and middleware to their own audit files. Not written in insecure mode.
Deny Reasons
The policy’s deny reason appears as reason on a middleware deny, in error.message on its audit record, and as reason from EvaluationService.
gRPC Status Codes
The policy service’s PolicyService and the gateway’s EvaluationService return these statuses. Refer to Service APIs for details.
Policy Service HTTP Status Codes
Next Steps
- For the record structure, refer to Audit Event Schema.
- To diagnose a failure from its symptom, refer to Troubleshooting.