{"@attributes":{"version":"2.0"},"channel":{"title":"Documentation on CPEX Documentation","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/","description":"Recent content in Documentation on CPEX Documentation","generator":"Hugo","language":"en-us","item":[{"title":"Vision","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/vision\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/vision\/","description":"<h1 id=\"a-reference-monitor-for-agents\">A Reference Monitor for Agents<a class=\"anchor\" href=\"#a-reference-monitor-for-agents\">#<\/a><\/h1>\n<p>An agent backed by an LLM acts across trust domains. It calls tools, invokes other agents over A2A (agent-to-agent), runs inference, and fetches prompts and resources. The model deciding which operation to run is untrusted: it can be steered by injected content, confused by tool output, or simply wrong. Authorization, delegation, and information-flow control cannot live inside that model.<\/p>\n<p>CPEX puts them at the boundary. It is a deterministic reference monitor between the untrusted LLM and the capabilities it invokes. Every operation passes through CPEX, which decides what happens using state the model cannot see or forge.<\/p>"},{"title":"Overview","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/overview\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/overview\/","description":"<h1 id=\"how-cpex-works\">How CPEX Works<a class=\"anchor\" href=\"#how-cpex-works\">#<\/a><\/h1>\n<h2 id=\"a-running-scenario\">A running scenario<a class=\"anchor\" href=\"#a-running-scenario\">#<\/a><\/h2>\n<p>Picture one agent serving several people. It answers questions by calling tools (an HR records service, a code repository, an email sender), invoking other agents over A2A, running inference, and fetching prompts and resources. The backends are shared. The callers are not: an HR analyst, an engineer, and a support rep each drive the same agent with different identities and different entitlements.<\/p>\n<p><img src=\"https:\/\/contextforge-org.github.io\/cpex\/images\/demo_scenario.png\" alt=\"One agent serves three users across HR, repo, and email backends; CPEX policy produces a different outcome per identity\" \/><\/p>"},{"title":"Threat Model","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/threat-model\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/threat-model\/","description":"<h1 id=\"threat-model\">Threat Model<a class=\"anchor\" href=\"#threat-model\">#<\/a><\/h1>\n<blockquote class='book-hint '>\n<p>This threat model defines the adversary CPEX assumes, the boundary it enforces, and what each deployment placement does and does not cover. See <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/vision\/\">Vision<\/a> for the underlying model.<\/p>\n<\/blockquote><h2 id=\"the-adversary\">The adversary<a class=\"anchor\" href=\"#the-adversary\">#<\/a><\/h2>\n<p>CPEX assumes the LLM driving an agent is compromised, or close enough that the difference does not matter. Three things make it untrusted:<\/p>\n<ul>\n<li><strong>Its inputs are attacker-reachable.<\/strong> Prompt injection can arrive through any content the model reads: user messages, tool results, fetched resources, other agents&rsquo; replies.<\/li>\n<li><strong>Its outputs are attacker-shaped.<\/strong> An injected instruction becomes a tool call, an argument value, an email body. The model is a confused deputy: it acts with the agent&rsquo;s authority on whoever&rsquo;s behalf the text says.<\/li>\n<li><strong>It cannot keep secrets or enforce rules.<\/strong> Anything in the context window can be exfiltrated through an allowed output channel, and any instruction in the prompt can be overridden by a later one.<\/li>\n<\/ul>\n<p>The assets at stake sit behind the agent: backend data (records, code, mail), the credentials the agent holds, tools with side effects (payments, writes, messages), and the integrity of the audit trail itself.<\/p>"},{"title":"Use Cases","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/use-cases\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/use-cases\/","description":"<h1 id=\"use-cases\">Use Cases<a class=\"anchor\" href=\"#use-cases\">#<\/a><\/h1>\n<blockquote class='book-hint '>\n<p>Each use case below runs end-to-end in the <a href=\"https:\/\/github.com\/praxis-proxy\/demos\/tree\/main\/demos\/policy-engine\">Praxis demo<\/a>: CPEX as the policy engine inside a real AI gateway, backed by a real IdP and a mock MCP backend. Every snippet is quoted from the demo&rsquo;s live config, and every scenario is a script you can run.<\/p>\n<\/blockquote><p>The demo realizes the <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/overview\/\">running scenario<\/a>: one agent, three callers, three kinds of backend reached over MCP. Identity decides the outcome.<\/p>"},{"title":"Quick Start","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/quickstart\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/quickstart\/","description":"<h1 id=\"quick-start\">Quick Start<a class=\"anchor\" href=\"#quick-start\">#<\/a><\/h1>\n<p>This walks through standing up CPEX as an enforcement point and running the <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/overview\/\">scenario<\/a>: the <code>get_employee<\/code> route that authorizes by role and redacts a field by permission.<\/p>\n<p>You need Rust 1.96 or newer (<a href=\"https:\/\/rustup.rs\">install with rustup<\/a>). Section 4 runs the tutorial&rsquo;s first module, which lives in the repo, so clone it first: <code>git clone https:\/\/github.com\/contextforge-org\/cpex.git &amp;&amp; cd cpex<\/code>, and run <code>cargo<\/code> commands from that root.<\/p>\n<p>Upgrading from 0.2.x? Read <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/migration-0.3\/\">Migrating to 0.3<\/a> first.<\/p>"},{"title":"Common Message Format","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/cmf\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/cmf\/","description":"<h1 id=\"common-message-format\">Common Message Format<a class=\"anchor\" href=\"#common-message-format\">#<\/a><\/h1>\n<p>APL evaluates policy against a request. The Common Message Format (CMF) is the shape of that request: a protocol-agnostic envelope that represents any mediated operation in one structure, so a single policy can apply across tool calls, A2A methods, inference, prompts, and resources without caring which protocol carried them.<\/p>\n<h2 id=\"why-a-common-format\">Why a common format<a class=\"anchor\" href=\"#why-a-common-format\">#<\/a><\/h2>\n<p>Without CMF, a redaction policy for tool results and a redaction policy for LLM output are different code against different payload types, even though they do the same thing. CMF gives every interception point the same representation, so cross-cutting policy is written once and evaluated everywhere. This is what lets the same APL field pipeline redact a field whether it arrived in a tool result or a model completion.<\/p>"},{"title":"CMF Extensions","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/cmf-extensions\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/cmf-extensions\/","description":"<h1 id=\"cmf-extensions-and-the-attribute-bag\">CMF Extensions and the Attribute Bag<a class=\"anchor\" href=\"#cmf-extensions-and-the-attribute-bag\">#<\/a><\/h1>\n<p>Policy reads a flat attribute bag. The engine fills it by walking each present slot on the request&rsquo;s <code>Extensions<\/code> into dotted keys. Plugins that are handed a typed slot still see the original struct. This page is the contract for what the bridge writes, how collections relate to the flattened booleans, and what each decision point does with a missing key.<\/p>\n<p><a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/extensions\/\">Extensions &amp; Capability-Gating<\/a> covers which capability unlocks each slot. This page covers the keys.<\/p>"},{"title":"Extensions & Capability-Gating","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/extensions\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/extensions\/","description":"<h1 id=\"extensions-and-capability-gating\">Extensions and Capability-Gating<a class=\"anchor\" href=\"#extensions-and-capability-gating\">#<\/a><\/h1>\n<p>Alongside the message, every operation carries typed <strong>extensions<\/strong>: the contextual state policy reasons about. Identity is an extension. So are security labels, the delegation chain, request headers, agent session context, and more. Each extension is bridged into the flat attribute bag APL reads, under a well-known namespace. <strong>Capability-gating<\/strong> controls which plugins may read or write each one.<\/p>\n<p>This is a supporting concern, not the headline. You rarely configure it directly. It matters because it is what makes least privilege real for the plugins that execute policy effects, and because the namespaces below are the exact keys an APL predicate or plugin can read.<\/p>"},{"title":"Identity & Delegation","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/identity-delegation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/identity-delegation\/","description":"<h1 id=\"identity--delegation\">Identity &amp; Delegation<a class=\"anchor\" href=\"#identity--delegation\">#<\/a><\/h1>\n<p>CPEX resolves the inbound caller and mints the outbound credential on every\nrequest. Select the recipe matching the required principal, copy its plugin and\nroute configuration, then check the support matrix for tested IdPs.<\/p>\n<p>The same config runs wherever you place it: in front of the tools, inside the\ntool server, or agent-side (see <a href=\"#where-to-place-cpex\">Where to place CPEX<\/a>).\nThroughout this page &ldquo;the enforcement point&rdquo; means &ldquo;wherever this CPEX instance\nruns.&rdquo;<\/p>"},{"title":"Identity Claim Mapping","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/identity-claim-mapping\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/identity-claim-mapping\/","description":"<h1 id=\"identity-claim-mapping\">Identity Claim Mapping<a class=\"anchor\" href=\"#identity-claim-mapping\">#<\/a><\/h1>\n<p>The <code>identity\/jwt<\/code> resolver builds a subject, a client and a workload identity from a token&rsquo;s claims. Which claims hold roles, scopes or the client id differs by IdP, so the mapping is configuration. You name a shipped preset or write the map inline, under the plugin&rsquo;s <code>config:<\/code>.<\/p>\n<p><strong>Surfaces.<\/strong> Mapping runs inside the engine, so the same config works from Rust, Python and Go. Python hosts call <code>identity.resolve<\/code> with an identity payload dict (<code>{&quot;source&quot;: &quot;bearer&quot;, &quot;headers&quot;: {...}}<\/code>); Go hosts use <code>NewIdentityPayload<\/code>. The resolved subject comes back on the result&rsquo;s modified payload.<\/p>"},{"title":"HTTP Routing","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/http-routing\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/http-routing\/","description":"<h1 id=\"http-routing\">HTTP Routing<a class=\"anchor\" href=\"#http-routing\">#<\/a><\/h1>\n<p>Most routes select an operation by name: a <code>tool:<\/code>, a <code>resource:<\/code>, a <code>prompt:<\/code>, an <code>llm:<\/code>. An <code>http:<\/code> route selects on the request line instead, so plain HTTP traffic that names no entity can still be authorized. One CPEX engine can then cover an agent&rsquo;s tool calls and the HTTP traffic around them under one policy document.<\/p>\n<p><strong>Surfaces.<\/strong> HTTP routes are reachable from the Rust facade only. The <code>http.request<\/code> and <code>http.response<\/code> hooks carry PPE&rsquo;s <code>HttpPayload<\/code>, which the Python and Go bindings do not build: a Python <code>invoke_hook(&quot;http.request&quot;, ...)<\/code> resolves the route and then fails with a <code>plugin_error<\/code> saying the <code>http<\/code> family expects <code>HttpPayload<\/code>. The Go <code>HttpExtension<\/code> also has no fields for the method, path or status. Python and Go hosts can still load a document that declares <code>http:<\/code> routes.<\/p>"},{"title":"Header Assertions","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/assertions\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/assertions\/","description":"<h1 id=\"header-assertions\">Header Assertions<a class=\"anchor\" href=\"#header-assertions\">#<\/a><\/h1>\n<p>CPEX validates tokens, maps claims into a typed identity, mints delegated credentials and accumulates labels. None of that reaches an upstream on its own. The <code>assertions:<\/code> block says which of it does, as request headers, and which response headers an upstream may not send back to a client.<\/p>\n<p>The block sits next to <code>authentication:<\/code> and holds two contracts:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;\"><code class=\"language-yaml\" data-lang=\"yaml\"><span style=\"display:flex;\"><span><span style=\"color:#f92672\">global<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#f92672\">assertions<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#f92672\">request<\/span>: <span style=\"color:#75715e\"># toward the upstream, on a pre-phase hook<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#f92672\">headers<\/span>: [<span style=\"color:#ae81ff\">...]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#f92672\">strip<\/span>: [<span style=\"color:#ae81ff\">...]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#f92672\">response<\/span>: <span style=\"color:#75715e\"># toward the client, on a post-phase hook<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#f92672\">headers<\/span>: [<span style=\"color:#ae81ff\">...]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#f92672\">strip<\/span>: [<span style=\"color:#ae81ff\">...]<\/span><\/span><\/span><\/code><\/pre><\/div><p><strong>Surfaces.<\/strong> Assertions run inside the engine, so they work the same from Rust, Python and Go. The host passes the inbound headers on the HTTP extension (<code>http.request_headers<\/code>) and forwards what comes back on the modified extensions: <code>result.modified_extensions[&quot;http&quot;]<\/code> in Python, <code>ModifiedExtensions<\/code> on the Go result. The <code>http:<\/code> route level is Rust only; see <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/http-routing\/\">HTTP Routing<\/a>.<\/p>"},{"title":"Plugins & Pipeline","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/pipeline\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/pipeline\/","description":"<h1 id=\"plugins-and-the-execution-pipeline\">Plugins and the Execution Pipeline<a class=\"anchor\" href=\"#plugins-and-the-execution-pipeline\">#<\/a><\/h1>\n<p>APL is the policy surface. The pipeline is what runs underneath it: the mechanism that executes a policy&rsquo;s effects. Most of the time you write APL and never touch the pipeline directly. You reach for it when you extend the set of effects available to policy, by adding a plugin, or when you need to understand exactly how and when effects run.<\/p>\n<h2 id=\"hooks\">Hooks<a class=\"anchor\" href=\"#hooks\">#<\/a><\/h2>\n<p>A <strong>hook<\/strong> is a named interception point. The host invokes a hook at an operation boundary (before a tool call, after an LLM completion, around a prompt or resource fetch), and the engine runs the plugins registered there. Hooks are where APL routes attach: a route&rsquo;s <code>authorization.pre_invocation<\/code> phase runs at the pre-invocation hook, its <code>result<\/code> phase at the post-invocation hook.<\/p>"},{"title":"Auditing","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/auditing\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/auditing\/","description":"<h1 id=\"auditing\">Auditing<a class=\"anchor\" href=\"#auditing\">#<\/a><\/h1>\n<p>CPEX decides who may call which tool and what comes back. Auditing is the record of those decisions, and of the irreversible acts plugins perform to carry them out.<\/p>\n<p>There are two records, and they answer different questions:<\/p>\n<ul>\n<li>A <strong>decision<\/strong> says how the pipeline ruled on one request: which plugins ran, what each did, and whether the request was allowed or blocked.<\/li>\n<li>An <strong>effect<\/strong> says what a plugin did to the outside world, such as minting a token at an IdP. Effects outlive the request and cannot be undone, so they are recorded separately and before the act.<\/li>\n<\/ul>\n<p>Both are off until you configure them. A plugin behaves the same either way: turning auditing off loses the record, not the behavior.<\/p>"},{"title":"Builtins","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/builtins\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/builtins\/","description":"<h1 id=\"builtins\">Builtins<a class=\"anchor\" href=\"#builtins\">#<\/a><\/h1>\n<p>CPEX ships a set of plugins, decision points, a session store and secret providers, all from the praxis-policy engine (PPE) builtins. Every CPEX surface carries the same set: the Rust facade, the Python package, the Go module and the C ABI. A config names a builtin by <code>kind<\/code>.<\/p>\n<h2 id=\"the-030-catalog\">The 0.3.0 catalog<a class=\"anchor\" href=\"#the-030-catalog\">#<\/a><\/h2>\n<table>\n\t<thead>\n\t\t\t<tr>\n\t\t\t\t\t<th>Kind<\/th>\n\t\t\t\t\t<th>Type<\/th>\n\t\t\t\t\t<th>Purpose<\/th>\n\t\t\t<\/tr>\n\t<\/thead>\n\t<tbody>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>identity\/jwt<\/code><\/td>\n\t\t\t\t\t<td>identity<\/td>\n\t\t\t\t\t<td>Resolve a subject from a verified JWT, with configurable claim mapping (see <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/identity\/\">Identity<\/a>).<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>identity\/api-key<\/code><\/td>\n\t\t\t\t\t<td>identity<\/td>\n\t\t\t\t\t<td>Resolve an opaque API key against a file or HTTP directory (see <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/identity-delegation\/#recipe-7-an-opaque-api-key-resolved-against-a-directory\">Identity &amp; Delegation<\/a>).<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>delegator\/oauth<\/code><\/td>\n\t\t\t\t\t<td>delegator<\/td>\n\t\t\t\t\t<td>RFC 8693 token exchange and <code>client_credentials<\/code>, with optional caching (see <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/delegation\/\">Delegation<\/a>).<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>delegator\/vault<\/code><\/td>\n\t\t\t\t\t<td>delegator<\/td>\n\t\t\t\t\t<td>Retrieve downstream credentials from Vault KV v2 for a user, client or workload. Authorize before delegation.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>elicitation\/ciba<\/code><\/td>\n\t\t\t\t\t<td>elicitation<\/td>\n\t\t\t\t\t<td>OIDC CIBA human approval (see <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/elicitation\/\">Elicitation<\/a>).<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>cedar-direct<\/code><\/td>\n\t\t\t\t\t<td>PDP resolver<\/td>\n\t\t\t\t\t<td>Evaluate Cedar policy (dialect <code>cedar<\/code>).<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>cel<\/code><\/td>\n\t\t\t\t\t<td>PDP resolver<\/td>\n\t\t\t\t\t<td>Evaluate CEL expressions (dialect <code>cel<\/code>).<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>opa<\/code><\/td>\n\t\t\t\t\t<td>PDP resolver<\/td>\n\t\t\t\t\t<td>Evaluate Rego, embedded, no sidecar (dialect <code>opa<\/code>).<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>valkey<\/code><\/td>\n\t\t\t\t\t<td>session store<\/td>\n\t\t\t\t\t<td>Persist taint labels across processes (see <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/tainting\/\">Session Tainting<\/a>).<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>env<\/code>, <code>file<\/code><\/td>\n\t\t\t\t\t<td>secret providers<\/td>\n\t\t\t\t\t<td>Read <code>secrets:<\/code> values from the environment or from files.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>vault<\/code><\/td>\n\t\t\t\t\t<td>secret provider<\/td>\n\t\t\t\t\t<td>Read <code>secrets:<\/code> values from Vault KV v2 over the host&rsquo;s HTTP transport.<\/td>\n\t\t\t<\/tr>\n\t<\/tbody>\n<\/table>\n<p>The default session store is in-process memory; no <code>kind<\/code> is needed for it, but its labels do not survive a restart or reach a second replica.<\/p>"},{"title":"Configuration","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/configuration\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/configuration\/","description":"<h1 id=\"configuration\">Configuration<a class=\"anchor\" href=\"#configuration\">#<\/a><\/h1>\n<p>A CPEX config is one YAML document. It declares the plugins the process can reach, the cross-cutting wiring, and the policy that decides which of them run for a given operation. The engine loads it and the APL visitor wires routes to hooks.<\/p>\n<p>Every key is known. A key the document model does not name fails the load, and where a key was renamed the error names its replacement. If your config loads, every key in it does something. Coming from 0.2.x? The <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/migration-0.3\/#config-keys\">migration guide<\/a> maps every removed key.<\/p>"},{"title":"Deployment","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/deployment\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/deployment\/","description":"<h1 id=\"deployment\">Deployment<a class=\"anchor\" href=\"#deployment\">#<\/a><\/h1>\n<p>CPEX is the enforcement point, but where that point sits is your choice. The same APL policy enforces whether CPEX runs as a gateway in front of a tool server, as an egress sidecar beside an agent, or inside an agent framework. You move the boundary; the policy does not change.<\/p>\n<h2 id=\"the-same-policy-any-enforcement-point\">The same policy, any enforcement point<a class=\"anchor\" href=\"#the-same-policy-any-enforcement-point\">#<\/a><\/h2>\n<p>Take the <code>get_compensation<\/code> route. It is identical whether CPEX fronts the backend, guards the agent&rsquo;s egress, or runs inside the agent runtime:<\/p>"},{"title":"Patterns","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/patterns\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/patterns\/","description":"<h1 id=\"patterns\">Patterns<a class=\"anchor\" href=\"#patterns\">#<\/a><\/h1>\n<p>Production patterns for writing and rolling out CPEX policy. Each is expressed in APL and builds on the concepts in the earlier pages. The <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/tutorial\/\">Tutorial<\/a> builds most of these hands-on; this page is the condensed reference for authoring and rollout.<\/p>\n<h2 id=\"layered-enforcement\">Layered enforcement<a class=\"anchor\" href=\"#layered-enforcement\">#<\/a><\/h2>\n<p>Order effects cheapest-gate-first so expensive work only runs for requests that survive the early checks. Attribute gates, then a PDP call, then delegation (built up in tutorial modules <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/tutorial\/04-effects\/\">4<\/a>, <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/tutorial\/05-pdp\/\">5<\/a>, and <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/tutorial\/06-delegation\/\">6<\/a>):<\/p>"},{"title":"Testing","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/testing\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/testing\/","description":"<h1 id=\"testing-policy\">Testing Policy<a class=\"anchor\" href=\"#testing-policy\">#<\/a><\/h1>\n<p>Policy is code, and it deserves tests. The behaviors worth covering are the ones the scenario demonstrates: a route allows the right callers, denies the wrong ones, redacts the right fields, and carries taint across a session. Because APL is declarative and evaluated by the runtime, you can test a route by loading a policy and driving operations through it, asserting the outcome, without standing up a live backend.<\/p>"},{"title":"Reference","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/reference\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/reference\/","description":"<h1 id=\"reference\">Reference<a class=\"anchor\" href=\"#reference\">#<\/a><\/h1>\n<p>CPEX 0.3 runs on the praxis-policy engine (PPE) 0.5.0. Rust hosts depend on the <code>cpex<\/code> facade, which re-exports PPE&rsquo;s public surface; plugin authors use <code>cpex::prelude<\/code>. The <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/crates\/\">Crate Map<\/a> lists every crate and what it re-exports.<\/p>\n<table>\n\t<thead>\n\t\t\t<tr>\n\t\t\t\t\t<th>Surface<\/th>\n\t\t\t\t\t<th>Entry point<\/th>\n\t\t\t\t\t<th>Where<\/th>\n\t\t\t<\/tr>\n\t<\/thead>\n\t<tbody>\n\t\t\t<tr>\n\t\t\t\t\t<td>Rust<\/td>\n\t\t\t\t\t<td><code>cpex::PolicyEngine<\/code><\/td>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/crates\/cpex\"><code>crates\/cpex<\/code><\/a>, <a href=\"https:\/\/docs.rs\/cpex\">docs.rs\/cpex<\/a><\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td>Python<\/td>\n\t\t\t\t\t<td><code>cpex.PolicyEngine<\/code> (<code>PluginManager<\/code> is an alias)<\/td>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/bindings\/python\"><code>bindings\/python<\/code><\/a><\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td>Go<\/td>\n\t\t\t\t\t<td><code>cpex.PolicyEngine<\/code><\/td>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/go\/cpex\"><code>go\/cpex<\/code><\/a><\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td>C ABI<\/td>\n\t\t\t\t\t<td><code>cpex_engine_*<\/code>, ABI version 3<\/td>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/crates\/cpex-ffi\"><code>crates\/cpex-ffi<\/code><\/a><\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td>Python plugins<\/td>\n\t\t\t\t\t<td><code>isolated_venv<\/code> kind (<code>python-host<\/code> feature)<\/td>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/crates\/cpex-hosts-python\"><code>crates\/cpex-hosts-python<\/code><\/a><\/td>\n\t\t\t<\/tr>\n\t<\/tbody>\n<\/table>\n<p>Engine API docs are on <a href=\"https:\/\/docs.rs\/praxis-policy\/0.5.0\">docs.rs\/praxis-policy\/0.5.0<\/a> and <a href=\"https:\/\/docs.rs\/praxis-policy-core\/0.5.0\">docs.rs\/praxis-policy-core\/0.5.0<\/a>.<\/p>"},{"title":"Crate Map","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/crates\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/crates\/","description":"<h1 id=\"crate-map\">Crate Map<a class=\"anchor\" href=\"#crate-map\">#<\/a><\/h1>\n<p>CPEX runs on the praxis-policy engine (PPE). The engine, the APL compiler and runtime, and the bundled builtins are PPE crates from crates.io. This repository holds what CPEX adds on top: the <code>cpex<\/code> facade, the language bindings, the Python plugin host, and the Biscuit delegator.<\/p>\n<p>Most Rust hosts depend on <code>cpex<\/code> and nothing else.<\/p>\n<h2 id=\"cpex-crates-and-packages\">CPEX crates and packages<a class=\"anchor\" href=\"#cpex-crates-and-packages\">#<\/a><\/h2>\n<table>\n\t<thead>\n\t\t\t<tr>\n\t\t\t\t\t<th>Crate or package<\/th>\n\t\t\t\t\t<th>Published<\/th>\n\t\t\t\t\t<th>Role<\/th>\n\t\t\t<\/tr>\n\t<\/thead>\n\t<tbody>\n\t\t\t<tr>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/crates\/cpex\"><code>cpex<\/code><\/a><\/td>\n\t\t\t\t\t<td>crates.io<\/td>\n\t\t\t\t\t<td>Host facade. Re-exports the whole public surface of <code>praxis-policy<\/code>, built with every stable builtin and the bundled hyper HTTP transport. Start here.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/crates\/cpex-hosts-python\"><code>cpex-hosts-python<\/code><\/a><\/td>\n\t\t\t\t\t<td>crates.io<\/td>\n\t\t\t\t\t<td>Runs existing Python CPEX plugins out of process, one cached virtualenv and one worker per plugin, under the <code>isolated_venv<\/code> kind. Reached through the <code>cpex<\/code> feature <code>python-host<\/code>.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/builtins\/plugins\/delegator-biscuit\"><code>cpex-plugin-delegator-biscuit<\/code><\/a><\/td>\n\t\t\t\t\t<td>crates.io<\/td>\n\t\t\t\t\t<td>A <code>token.delegate<\/code> handler that attenuates Biscuit capability tokens. A Rust host registers it in code.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/crates\/cpex-ffi\"><code>cpex-ffi<\/code><\/a><\/td>\n\t\t\t\t\t<td>signed release artifacts<\/td>\n\t\t\t\t\t<td>C ABI over the engine (<code>cdylib<\/code> and <code>staticlib<\/code>). The Go package links it.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/bindings\/python\"><code>cpex-python<\/code><\/a><\/td>\n\t\t\t\t\t<td>crates.io<\/td>\n\t\t\t\t\t<td>PyO3 bindings, built with maturin into the Python package <code>cpex<\/code>: the Python <code>PolicyEngine<\/code>.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><a href=\"https:\/\/github.com\/contextforge-org\/cpex\/tree\/main\/go\/cpex\"><code>go\/cpex<\/code><\/a><\/td>\n\t\t\t\t\t<td>Go module<\/td>\n\t\t\t\t\t<td>cgo wrapper over <code>cpex-ffi<\/code>: the Go <code>PolicyEngine<\/code>.<\/td>\n\t\t\t<\/tr>\n\t<\/tbody>\n<\/table>\n<p><code>cpex-ffi<\/code> and <code>cpex-python<\/code> share the builtin registration, transport and secret-provider wiring in <code>cpex::host<\/code>.<\/p>"},{"title":"Migrating to 0.3","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/migration-0.3\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/migration-0.3\/","description":"<h1 id=\"migrating-from-02x-to-03\">Migrating from 0.2.x to 0.3<a class=\"anchor\" href=\"#migrating-from-02x-to-03\">#<\/a><\/h1>\n<p>CPEX 0.3.0 runs on the praxis-policy engine (PPE) 0.5.0 from crates.io instead of its own engine crates. The API names, hook names, several config keys, defaults and security checks change. This page lists every change a 0.2.x user has to act on, by surface.<\/p>\n<p>Work through it in this order:<\/p>\n<ol>\n<li><a href=\"#rust-api\">Rust<\/a>, <a href=\"#python-api\">Python<\/a>, <a href=\"#go-api\">Go<\/a> or <a href=\"#c-abi-v3\">C ABI<\/a>: rename the API calls for your surface.<\/li>\n<li><a href=\"#hook-names\">Hook names<\/a>: rename <code>hooks:<\/code> entries and hook names your code invokes.<\/li>\n<li><a href=\"#config-keys\">Config keys<\/a>: rewrite the policy document.<\/li>\n<li><a href=\"#new-required-capability-perform_http\">Capabilities<\/a>, <a href=\"#dispatch-defaults-to-policy\">dispatch<\/a> and <a href=\"#outbound-http-and-private-destinations\">egress<\/a>: the behavior changes that load fine but act differently.<\/li>\n<li><a href=\"#builtins-added-and-removed\">Builtins<\/a> and <a href=\"#secret-refresh-is-the-hosts-job\">secrets<\/a>: the bundled set changed.<\/li>\n<\/ol>\n<p>Load the migrated config through your own host. A 0.3.0 load names every key, hook and plugin it rejects, so read the whole error before fixing the first line.<\/p>"}]}}