Skip to main content

AccessRecord Schema

Complete reference for the AccessRecord structure emitted by the Policy Decision Point (PDP) for every authorization decision.

Overview

The AccessRecord captures the complete context of a policy evaluation, enabling audit, debugging, analytics, and policy replay.

OutputAvailabilityDescription
JSON to stdout
Community
Stream records for custom processing pipelines
ElasticSearch
Premium
Durable storage with indexing and analytics

Top-Level Structure

{
"metadata": { ... },
"principal": { ... },
"operation": "string",
"resource": "string",
"decision": "GRANT | DENY",
"references": [ ... ],
"porc": "string",
"system_override": false,
"grant_reason": "...",
"deny_reason": "..."
}

Fields

metadata

Contextual information about the decision.

FieldTypeDescription
timestampstring (ISO 8601)When the decision was made
idstring (UUID)Unique identifier for this record
envobjectOptional key-value pairs for deployment context

Example:

{
"timestamp": "2024-01-15T10:30:00.123Z",
"id": "550e8400-e29b-41d4-a716-446655440000",
"env": {
"service": "api-gateway",
"pod": "api-gw-7d9f8b6c4-x2m9k",
"region": "us-east-1"
}
}

principal

The authenticated subject making the request.

FieldTypeDescription
subjectstringThe principal identifier (e.g., user ID, service account)
realmstringThe authentication realm or domain

Example:

{
"subject": "alice@example.com",
"realm": "employees"
}

operation

The operation being attempted, from the PORC expression.

Type: string

Example: "api:documents:read", "http-post", "graphql-mutate"

resource

The resource MRN being accessed, from the PORC expression.

Type: string

Example: "mrn:app:document:12345", "mrn:http:/api/users"

decision

The top-level authorization outcome.

Type: enum

ValueDescription
GRANTAccess was permitted
DENYAccess was denied

references

Array of policy bundle references detailing each policy evaluated during the decision.

See BundleReference below.

porc

The complete PORC expression that was evaluated, serialized as JSON.

Type: string (JSON)

This field enables policy replay—you can deserialize this value and re-evaluate it against different policy versions to understand how changes would affect decisions.

system_override

Indicates whether the decision was made by a system-level bypass rather than normal policy evaluation.

Type: boolean

When true, check grant_reason or deny_reason for the bypass type.

grant_reason / deny_reason

When system_override is true, indicates why the bypass occurred.

Grant Reasons:

ValueDescription
PUBLICResource is marked as public
VISITORVisitor access is permitted
ANTI_LOCKOUTAnti-lockout protection triggered

Deny Reasons:

ValueDescription
JWT_REQUIREDA valid JWT is required but not present
OPERATOR_REQUIREDOperator-level access is required

BundleReference

Each policy bundle evaluated during the decision is recorded as a BundleReference.

{
"id": "string",
"policies": [ ... ],
"decision": "GRANT | DENY",
"phase": "OPERATION | IDENTITY | RESOURCE | SCOPE",
"reason_code": "...",
"reason": "string"
}

Fields

FieldTypeDescription
idstringOperation name or role MRN
policiesarrayList of PolicyReference objects
decisionenumOutcome of this bundle: GRANT or DENY
phaseenumWhich conjunction phase (see below)
reason_codeenumSuccess or error type (see below)
reasonstringHuman-readable explanation, especially for errors

Phase

Indicates which conjunction phase the bundle belongs to.

ValueDescription
OPERATIONPhase 1: Operation-level policies
IDENTITYPhase 2: Role-based policies
RESOURCEPhase 3: Resource group policies
SCOPEPhase 4: Scope constraint policies

ReasonCode

Indicates the evaluation outcome type.

ValueDescription
POLICY_OUTCOMENormal policy evaluation completed
COMPILATION_ERRORPolicy failed to compile
NOTFOUND_ERRORReferenced policy could not be found
NETWORK_ERRORNetwork issue prevented policy resolution
EVALUATION_ERROROPA evaluation error (not compilation)
INVALPARAM_ERRORInvalid parameter or identifier
UNKNOWN_ERRORUnspecified error

When reason_code is not POLICY_OUTCOME, the reason field typically contains details about the error.

PolicyReference

Individual policy identification within a bundle.

{
"mrn": "string",
"fingerprint": "bytes"
}
FieldTypeDescription
mrnstringThe policy's Manetu Resource Notation identifier
fingerprintbytesCryptographic hash of the policy content

The combination of mrn and fingerprint uniquely identifies the exact policy version that was evaluated. This is critical for forensic analysis—even after policies are updated, you can determine exactly which version produced a particular decision.

Complete Example

{
"metadata": {
"timestamp": "2024-01-15T10:30:00.123Z",
"id": "550e8400-e29b-41d4-a716-446655440000",
"env": {
"service": "document-service",
"environment": "production"
}
},
"principal": {
"subject": "alice@example.com",
"realm": "corporate"
},
"operation": "api:documents:update",
"resource": "mrn:app:document:confidential-report-2024",
"decision": "DENY",
"references": [
{
"id": "api:documents:update",
"policies": [
{
"mrn": "mrn:iam:policy:require-authenticated",
"fingerprint": "YTNmMmI4YzE..."
}
],
"decision": "GRANT",
"phase": "OPERATION",
"reason_code": "POLICY_OUTCOME"
},
{
"id": "mrn:iam:role:editor",
"policies": [
{
"mrn": "mrn:iam:policy:editor-access",
"fingerprint": "ZDRlNWY2YTc..."
}
],
"decision": "GRANT",
"phase": "IDENTITY",
"reason_code": "POLICY_OUTCOME"
},
{
"id": "mrn:iam:resource-group:confidential",
"policies": [
{
"mrn": "mrn:iam:policy:confidential-access",
"fingerprint": "YjJjM2Q0ZTU..."
}
],
"decision": "DENY",
"phase": "RESOURCE",
"reason_code": "POLICY_OUTCOME",
"reason": "Principal lacks 'confidential' clearance annotation"
}
],
"porc": "{\"principal\":{\"sub\":\"alice@example.com\",\"mroles\":[\"mrn:iam:role:editor\"]},\"operation\":\"api:documents:update\",\"resource\":\"mrn:app:document:confidential-report-2024\",\"context\":{}}",
"system_override": false
}

In this example, the request passed Phase 1 (Operation) and Phase 2 (Identity), but was denied in Phase 3 (Resource) because the resource belongs to a confidential resource group and the principal lacks the required clearance.

See Also