{"@attributes":{"version":"2.0"},"channel":{"title":"APL on CPEX Documentation","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/","description":"Recent content in APL on CPEX Documentation","generator":"Hugo","language":"en-us","item":[{"title":"Effects & Sequencing","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/effects\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/effects\/","description":"<h1 id=\"effects-and-sequencing\">Effects and Sequencing<a class=\"anchor\" href=\"#effects-and-sequencing\">#<\/a><\/h1>\n<p>An APL rule does something. That something is an <strong>effect<\/strong>. Effects are the building blocks of policy: a <code>pre_invocation:<\/code> block is an ordered list of them, and they run in sequence until one denies.<\/p>\n<h2 id=\"the-effects\">The effects<a class=\"anchor\" href=\"#the-effects\">#<\/a><\/h2>\n<table>\n\t<thead>\n\t\t\t<tr>\n\t\t\t\t\t<th>Effect<\/th>\n\t\t\t\t\t<th>What it does<\/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>allow<\/code><\/td>\n\t\t\t\t\t<td>No-op. Continue to the next effect.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>deny<\/code> \/ <code>deny('reason')<\/code> \/ <code>deny('reason', 'code')<\/code><\/td>\n\t\t\t\t\t<td>Halt the phase and all later phases with a violation.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>run(name)<\/code><\/td>\n\t\t\t\t\t<td>Invoke a registered plugin (audit log, custom check, content scan). <code>plugin(name)<\/code> from 0.2.x is rejected.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td><code>delegate(name, ...)<\/code><\/td>\n\t\t\t\t\t<td>Mint a downstream credential via a delegator plugin. 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>require_approval(name, ...)<\/code> \/ <code>confirm(...)<\/code> \/ <code>require_step_up(...)<\/code> \/ <code>require_attestation(...)<\/code> \/ <code>request_info(...)<\/code> \/ <code>require_review(...)<\/code><\/td>\n\t\t\t\t\t<td>Ask a human and suspend the operation until they respond. 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>taint(label[, scope])<\/code><\/td>\n\t\t\t\t\t<td>Attach a label to the session or message. 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>restrict: { ... }<\/code><\/td>\n\t\t\t\t\t<td>Narrow the set of backends the router may select from. See <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/restrict\/\">Backend Restriction<\/a>.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td>field pipelines<\/td>\n\t\t\t\t\t<td>Validate or transform <code>args<\/code>\/<code>result<\/code> fields. See <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/\">APL<\/a>.<\/td>\n\t\t\t<\/tr>\n\t\t\t<tr>\n\t\t\t\t\t<td>PDP call (<code>cedar:<\/code>, <code>cel:<\/code>, <code>opa:<\/code>)<\/td>\n\t\t\t\t\t<td>Delegate the decision to a policy engine. See <a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/pdp\/\">PDP Integration<\/a>.<\/td>\n\t\t\t<\/tr>\n\t<\/tbody>\n<\/table>\n<h2 id=\"sequencing-and-halt-on-deny\">Sequencing and halt-on-deny<a class=\"anchor\" href=\"#sequencing-and-halt-on-deny\">#<\/a><\/h2>\n<p>Effects in a <code>pre_invocation:<\/code> block run top to bottom. The first <code>deny<\/code> halts the phase and skips every later phase, so order is a tool: put cheap gates first and expensive effects last.<\/p>"},{"title":"PDP Integration","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/pdp\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/pdp\/","description":"<h1 id=\"pdp-integration\">PDP Integration<a class=\"anchor\" href=\"#pdp-integration\">#<\/a><\/h1>\n<p>APL predicates handle attribute checks well: roles, permissions, scopes,\ncomparisons. They are a poor fit for relationship questions (&ldquo;is this user on\nthe team that owns this repo?&rdquo;) and for policy you already maintain in a\ndedicated engine. For those, APL hands the decision to a Policy Decision\nPoint.<\/p>\n<h2 id=\"decision-requirement\">Decision requirement<a class=\"anchor\" href=\"#decision-requirement\">#<\/a><\/h2>\n<p>The scenario&rsquo;s repository search must allow a read when the caller is an\nengineer and the repo is internal, or when the caller is on the security team,\nregardless of repo. That is a relationship-and-attribute decision over entities,\nwhich is exactly what an engine like Cedar exists to express. APL should make\nthe coarse gate and let the engine make the fine-grained call.<\/p>"},{"title":"Identity & IdP","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/identity\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/identity\/","description":"<h1 id=\"identity-and-idp-integration\">Identity and IdP Integration<a class=\"anchor\" href=\"#identity-and-idp-integration\">#<\/a><\/h1>\n<p>Policy reads attributes: <code>role.hr<\/code>, <code>perm.view_ssn<\/code>, <code>subject.id<\/code>. Those attributes have to come from somewhere trustworthy. They come from identity resolution, which runs before policy and turns a verified credential into the attribute bag that predicates read.<\/p>\n<h2 id=\"the-requirement\">The requirement<a class=\"anchor\" href=\"#the-requirement\">#<\/a><\/h2>\n<p>The scenario authorizes with <code>require(role.hr)<\/code> and redacts with <code>redact(!perm.view_ssn)<\/code>. For those to mean anything, CPEX must know, for each request, who the caller is and what roles and permissions they hold, established from a token the caller cannot forge, not from anything the LLM said.<\/p>"},{"title":"Static Attributes","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/attributes\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/attributes\/","description":"<h1 id=\"static-attributes\">Static Attributes<a class=\"anchor\" href=\"#static-attributes\">#<\/a><\/h1>\n<p>Policy reads attributes. Most come from the request: the verified subject and its roles (<a href=\"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/identity\/\">Identity<\/a>), request headers, session labels. But some attributes are carried by nothing and fetched from nowhere: they are <strong>operator-maintained facts<\/strong> known at configuration time. Which region a tenant&rsquo;s data is resident in. Which models an agent is allowed to use. The org&rsquo;s default region. These are the <em>static attributes<\/em>, and they live in a plain data tree under the <code>data.*<\/code> namespace.<\/p>"},{"title":"Delegation","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/delegation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/delegation\/","description":"<h1 id=\"delegation-and-token-exchange\">Delegation and Token Exchange<a class=\"anchor\" href=\"#delegation-and-token-exchange\">#<\/a><\/h1>\n<p>When CPEX forwards an operation to a backend, the backend needs a credential. Forwarding the caller&rsquo;s inbound token is usually wrong: it is scoped for the agent, not the backend, and it carries more privilege than the operation needs. Delegation mints a fresh, narrowly scoped credential for the specific downstream call.<\/p>\n<h2 id=\"the-requirement\">The requirement<a class=\"anchor\" href=\"#the-requirement\">#<\/a><\/h2>\n<p>The scenario&rsquo;s <code>get_compensation<\/code> reads from a backend HR system that expects its own audience-scoped token with only the <code>read_compensation<\/code> scope. The caller never holds that token. CPEX must exchange the caller&rsquo;s verified identity for a downstream credential, scoped down to exactly what the operation needs, and only after authorization has passed.<\/p>"},{"title":"Elicitation","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/elicitation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/elicitation\/","description":"<h1 id=\"human-in-the-loop-elicitation\">Human-in-the-Loop Elicitation<a class=\"anchor\" href=\"#human-in-the-loop-elicitation\">#<\/a><\/h1>\n<p>Some operations should not proceed on the caller&rsquo;s say-so alone. A large payroll change wants a manager&rsquo;s approval; a destructive action wants the user to confirm; a sensitive read wants a fresh second factor. Elicitation lets a policy <strong>pause an operation to ask a human<\/strong> and resume once they respond, without blocking the request path, and with the decision bound to the actual request rather than to an LLM&rsquo;s paraphrase of it.<\/p>"},{"title":"Session Tainting","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/tainting\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/tainting\/","description":"<h1 id=\"session-tainting-and-information-flow\">Session Tainting and Information Flow<a class=\"anchor\" href=\"#session-tainting-and-information-flow\">#<\/a><\/h1>\n<p>Some controls cannot be decided from a single request. &ldquo;Do not send anything externally after reading secret data&rdquo; depends on what the session did earlier. CPEX tracks that history as <strong>taint labels<\/strong>: facts attached to a session that later policy can read. This is how CPEX enforces information-flow control, including write-down prevention.<\/p>\n<h2 id=\"the-requirement\">The requirement<a class=\"anchor\" href=\"#the-requirement\">#<\/a><\/h2>\n<p>A caller reads compensation data, then asks the agent to send an email. The email body is clean: no SSN, no salary, nothing sensitive in the text. It should still be blocked, because this session has handled secret data and an external send is a write-down. The LLM cannot be trusted to remember this or to refuse on its own, and a content scan of the email body would not catch it. The control has to live in state the model cannot see.<\/p>"},{"title":"Backend Restriction","link":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/restrict\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/contextforge-org.github.io\/cpex\/docs\/apl\/restrict\/","description":"<h1 id=\"backend-restriction\">Backend Restriction<a class=\"anchor\" href=\"#backend-restriction\">#<\/a><\/h1>\n<p>Some controls are not about <em>whether<\/em> an operation runs, but <em>where<\/em> it runs. &ldquo;EU customer data must be inferred on EU backends.&rdquo; &ldquo;This tenant may only use the cheap model tier.&rdquo; The agent asks for a <strong>class<\/strong> of backend (&ldquo;inference&rdquo;) and policy shapes which concrete backends are eligible. That shaping is the <code>restrict<\/code> effect.<\/p>\n<p><code>restrict<\/code> declares a predicate over backend attributes, narrowing the set of backends the host&rsquo;s router may select from. It never picks a backend and never allows or denies the request; the router still chooses the best survivor by health and load. Like <code>taint<\/code>, it is an <strong>accumulating<\/strong> effect: every <code>restrict<\/code> that fires only ever <em>narrows<\/em> the set, and multiple restrictions compose by conjunction.<\/p>"}]}}