Skip to navigation

Integrations and Extensibility Overview

View as Markdown

APF separates stable integration contracts from the individual implementations that use them. A contract is a wire format, a schema, or a Rust trait that APF commits to. An implementation, such as the OpenShell adapters, plugs into a contract. This page lists both and the rules that keep them compatible.

Integration Contracts

ContractKindDefined inUsed for
Policy authoring schemasJSON Schema 2020-12contracts/jsonschema/Validating authored documents.
Policy intermediate representationProtobufcontracts/proto/nvidia/agent_policy_fabric/policy/v1alpha1/The canonical form of every document kind and of the bundle envelope.
PolicyServicegRPCcontracts/proto/.../policy_service/v1alpha1/policy_service.protoFetching projected documents from the policy service.
EvaluationServicegRPCcontracts/proto/.../pdp/v1alpha1/pdp.protoAsking the gateway for a decision.
RuntimeContextProtobufcontracts/proto/.../runtime/v1alpha1/runtime.protoCaller identity and audit context on every request.
PolicyInformationServicegRPCcontracts/proto/.../pip/v1alpha1/pip.protoSupplying attested facts to the gateway’s Enrichment stage. Providers implement it, and the gateway calls it.
apf.audit.event.v1JSON Schemacontracts/audit/apf.audit.event.v1.schema.jsonEvery audit record APF emits.

Refer to Service APIs and Audit Event Schema.

Extension Points

Extension pointInterfaceLets you
Runtime projectionProjector trait in apf-compilerLower APF policy into another runtime’s native configuration.
Enforcement pointapf-<name>-* adapter cratesConnect another enforcement point to APF. Refer to APF Adapter.
SigningBundleSigner and BundleVerifier traits in apf-types, plus the trust-root key formatsBring your own signing authority.
Policy languageEvaluator trait in apf-policy-eval, and spec.languageAdd a decision engine. Only cedar is registered today.
Context enrichmentContextEnricher trait in apf-policy-eval, and the PolicyInformationService contractSupply attested facts to decisions from an external system. Refer to Policy Information Providers.
Bundle sourcePolicySource trait in apf-policy-serviceLoad bundles from another kind of store. Local files and HTTP are provided.
Policy name resolutionPolicyResolver trait in apf-policy-serviceChoose a bundle variant per caller.
Anti-rollback storageCounterStore in apf-bundleA concrete file-backed store, not a trait. Replacing it with a shared store means changing apf-bundle.

Refer to Adapter Contracts for each interface.

Available Integrations

IntegrationStatusPage
NVIDIA OpenShell gateway interceptor and supervisor middlewareAvailableOpenShell
Bring your own signing authorityAvailableExternal Policy Authorities
An adapter for another enforcement pointAvailable as an extension point, no second adapter shipsAPF Adapter
Policy information providersAvailablePolicy Information Providers

Compatibility Rules

The repository follows these conventions. Some are enforced in CI, and the exceptions that exist today are listed.

  • Wire contracts evolve compatibly. A breaking change to a protobuf contract needs a new package, and a breaking change to a JSON Schema needs a new $id. CI runs buf breaking against the default branch. The JSON Schema rule has no automated check.
  • Dependencies flow one way. Library crates do not depend on service or adapter crates, services do not depend on each other, and an adapter may depend only on a leaf adapter that has no adapter dependencies of its own. Services link the adapters they host. cargo xtask dag-guard checks these rules.
  • Runtime types stay at the edges. OpenShell-specific logic lives in the apf-openshell-* adapter crates. The exceptions are apf-proto, which generates the OpenShell protobuf types, and the two service binaries, which wire in the OpenShell adapters.
  • Signing stays behind one seam. Bundle verification goes through BundleVerifier, and only apf-bundle’s signing backend and the apf-compile tool import the yaml-sigil crates. apf-compile genfixture signs with yaml-sigil directly.
  • Public binaries stay public. The service binaries compile without private organization dependencies. Organization-specific behavior belongs in a separate composition binary built on APF’s traits.
  • Licenses are checked. New dependencies must pass the cargo-deny license allowlist, which admits MIT and Apache-2.0 and per-crate exceptions only.

Validating an Integration

For an integration in the repository, run the repository checks:

cargo build
cargo nextest run
cargo xtask dag-guard
cargo fmt --check
cargo clippy -- -D warnings
cargo deny check
buf lint contracts/

For a runtime integration, also run the runtime’s own extension protocol negotiation against the adapter. For OpenShell, a gateway that cannot negotiate the extension protocol refuses to start. Refer to Support and Compatibility.

A conformance suite for third-party runtimes and signing authorities is not yet in the repository.

Next Steps

  • To integrate with OpenShell, refer to OpenShell.
  • To connect another enforcement point, refer to APF Adapter.