Skip to content

Commit 0d4efb3

Browse files
committed
docs: reposition README and doc pages as a policy enforcement runtime
Reframe CPEX around the agentic enforcement pipeline rather than a new authorization language, and align the doc pages that repeated the old README intro. - README: lead with 'policy enforcement runtime for AI agents'; replace the RBAC-looking opener with the end-to-end three-entity demo (routes extracted from the HR demo); add per-entity 'policy lives on the entity' framing with apl_overview.png; add an explicit 'beyond request-level authorization' section (information flow across operations, delegation as policy, decision orchestration over Cedar/OPA/AuthZEN/CEL); align the subtitle. - docs landing + docs/_index + apl/_index: drop the duplicated 'policy and authorization framework' tagline for the runtime/per-operation framing; APL intro leads with 'capabilities rather than requests'. - Wire the new figures into the docs: apl_overview.png (APL anatomy) and demo_scenario.png (the running scenario in overview). Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
1 parent 50a774e commit 0d4efb3

8 files changed

Lines changed: 73 additions & 53 deletions

File tree

README.md

Lines changed: 63 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# CPEX
66

7-
<i>A policy and authorization framework for agentic applications.</i>
7+
<i>A policy enforcement runtime for AI agents.</i>
88

99
[![CI](https://github.com/contextforge-org/cpex/actions/workflows/ci.yml/badge.svg)](https://github.com/contextforge-org/cpex/actions/workflows/ci.yml)
1010
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
@@ -17,84 +17,98 @@
1717
1818
## What's CPEX?
1919

20-
CPEX is a deterministic reference monitor between an untrusted agent and the capabilities it invokes.
20+
CPEX is a policy enforcement runtime for AI agents.
2121

22-
AI agents can be steered by injected content, confused by tool output, or simply make mistakes. CPEX mediates every operation an agent triggers (tool calls, A2A methods, inference calls, prompt and resource fetches) against state the agent cannot see or forge: identity, delegation chains, taint labels, and an append-only audit log.
22+
It acts as a deterministic reference monitor between an agent and every capability it invokes: tools, prompts, resources, inference providers, and A2A methods. Every operation is evaluated against security state the model cannot observe or influence—identity, delegation chains, information-flow labels, and an append-only audit log.
23+
24+
Instead of scattering authorization, delegation, redaction, auditing, and information-flow controls across application code, CPEX executes them as a single policy-defined pipeline. Identity can be resolved, an external PDP consulted, credentials exchanged, inputs or outputs transformed, session state updated, and the operation audited—all within one deterministic flow.
2325

2426
<div>
2527
<img alt="CPEX mediates every operation an untrusted LLM triggers, evaluating APL policy against identity, delegation, taint, and audit state the model cannot forge" src="https://github.com/contextforge-org/cpex/blob/main/docs/static/images/cpex_overview.png?raw=true" />
2628
</div>
2729

28-
You write policy in APL (Authorization Policy Language): declarative, attribute-based rules with explicit effects. CPEX evaluates that policy at the boundary and enforces the result, allowing, denying, redacting, delegating, or tainting before the operation proceeds.
30+
## Policy lives on the entity
31+
32+
APL is a declarative policy language designed around capabilities rather than requests.
33+
34+
Every entity an agent can invoke—a tool, resource, prompt, or A2A method—owns its own policy. Each policy executes in two phases: before invocation and after the result. Most policies fit comfortably on a single screen.
2935

30-
## Same request, different data
36+
A route identifies an entity and defines the enforcement pipeline. Predicates decide whether execution may continue (`require`). PDPs evaluate external authorization (`cel`, `cedar`, or custom resolvers). Effects perform enforcement (`delegate`, `redact`, `taint`, `run`). Steps execute deterministically, in order, with only the context they explicitly declare.
3137

32-
Three callers issue the identical `get_compensation` request. The backend returns the same record. What each receives differs, because policy decides per identity.
38+
## End-to-end enforcement, multiple security contexts
39+
40+
The example below places CPEX between a single agent and three backends: HR records, source repositories, and email. The agent remains unchanged. Policy adapts each operation to the caller's identity, permissions, and session state.
41+
42+
<div>
43+
<img alt="One agent serves three users across HR, repo, and email backends; CPEX policy produces a different outcome per identity" src="https://github.com/contextforge-org/cpex/blob/main/docs/static/images/demo_scenario.png?raw=true" />
44+
</div>
45+
46+
One policy defines three distinct enforcement pipelines, one for each entity.
3347

3448
```yaml
3549
routes:
50+
# HR lookup: gate on role, scope a downstream token, redact by permission, taint the session.
3651
- tool: get_compensation
3752
policy:
3853
- "require(role.hr)"
54+
- "delegate(workday-oauth, target: workday-api, permissions: [read_compensation])"
55+
- "taint(secret, session)"
56+
- "run(audit-log)"
3957
result:
4058
ssn: "str | redact(!perm.view_ssn)"
59+
60+
# Repo search: gate on team, decide with CEL (or Cedar), require the scoped grant.
61+
- tool: search_repos
62+
policy:
63+
- "require(team.engineering | team.security)"
64+
- cel:
65+
expr: "(role.engineer && args.visibility == 'internal') || role.security"
66+
on_deny: ["deny('engineers read internal only; security reads any', 'cel.policy_denied')"]
67+
- "delegate(github-oauth, target: github-api, permissions: [repo:read:internal])"
68+
- "run(audit-log)"
69+
70+
# Outbound email: refuse if the session already touched secret data.
71+
- tool: send_email
72+
policy:
73+
- "require(perm.email_send)"
74+
- "run(pii-scan)"
75+
- "security.labels contains \"secret\": deny('write-down blocked', 'session_tainted')"
76+
- "run(audit-log)"
4177
```
4278
43-
- An HR analyst with `view_ssn` gets the full record.
44-
- An HR analyst without `view_ssn` gets the record with the SSN redacted before it leaves CPEX. The backend never sees the difference.
45-
- An engineer is denied at `require(role.hr)`. The call never reaches the backend.
79+
Two examples illustrate the behavior:
4680
47-
No application code changed between the three outcomes. The policy did.
81+
- **Same request, different result.** An HR analyst with `view_ssn` receives the full record. Without that permission, the SSN is redacted before the response leaves CPEX. Engineers never reach the backend because the request is rejected by `require(role.hr)`.
4882

49-
## What you can express
83+
- **Information follows the session.** Reading compensation data taints the session. Later attempts to send external email are blocked—even if the email itself contains no sensitive content.
5084

51-
APL composes the controls an agent stack needs, evaluated against identity claims, relationships, roles, and attributes (ReBAC, RBAC, ABAC). A few sketches:
85+
The application stays the same. Only the policy changes.
5286

53-
**Authorization** on both request inputs and response outputs, for tools, resources, prompts, A2A methods, and other agent interfaces:
87+
## Beyond request-level authorization
5488

55-
```yaml
56-
policy:
57-
- "require(role.hr | role.security)"
58-
args:
59-
region: "enum(us, eu, apac)" # validate inputs
60-
result:
61-
salary: "int | redact(!perm.view_comp)" # redact outputs by permission
62-
```
89+
RBAC, ABAC, Cedar, OPA, AuthZEN, and similar systems answer an important question:
6390

64-
**PDP composition**: gate with your preferred policy engine (CEL and Cedar ship as builtins; OPA, AuthZEN, and NeMo are recognized dialects you wire to a host resolver):
91+
> Should this request be allowed?
6592

66-
```yaml
67-
policy:
68-
- cel:
69-
expr: "subject.department == 'compliance' || 'admin' in subject.roles"
70-
on_deny:
71-
- "deny('not permitted by policy', 'pdp_denied')"
72-
```
93+
CPEX answers a broader one:
7394

74-
**Delegation** as an explicit effect: RFC 8693 token exchange that scopes and reduces privilege before downstream calls, verified after the exchange:
95+
> What security pipeline should execute for this agent operation?
7596

76-
```yaml
77-
policy:
78-
- "delegate(workday-oauth, target: workday-api, permissions: [read_compensation])"
79-
- "delegation.granted.permissions contains 'read_compensation': allow"
80-
```
97+
That pipeline can combine request authorization with credential delegation, response transformation, information-flow tracking, auditing, and session state into a single deterministic policy.
8198

82-
**Information-flow control**: session tainting that detects and blocks write-down, for example refusing an external send after the session touched secret data:
99+
Three capabilities distinguish this model:
83100

84-
```yaml
85-
# get_compensation taints the session
86-
policy: ["require(role.hr)", "taint(secret, session)"]
87-
# send_email, later in the same session, refuses even with a clean body
88-
policy:
89-
- "require(perm.email_send)"
90-
- "security.labels contains \"secret\": deny('write-down blocked', 'session_tainted')"
91-
```
101+
- **Information flow across operations.** Policy can carry security state across an entire agent session, preventing write-down and other cross-call attacks rather than evaluating each request in isolation.
102+
103+
- **Delegation as policy.** OAuth token exchange (RFC 8693), capability reduction, and downstream credential verification become ordinary policy steps instead of bespoke integration code.
92104

93-
The pipeline underneath (hooks, the plugin manager, execution modes) is the mechanism that runs policy effects. It is the supporting layer. APL is how you express intent; the pipeline is how that intent executes. Plugins are capability-gated, so an effect only sees the context it declares.
105+
- **Decision orchestration.** Existing authorization systems remain the source of truth. APL invokes Cedar, CEL, OPA, AuthZEN, or custom resolvers wherever a decision is needed, while CPEX enforces the resulting security pipeline.
94106

95107
## Where it runs
96108

97-
CPEX is direction-agnostic. The same policy enforces whether CPEX sits in front of a tool server as a gateway, beside an agent as an egress sidecar, or inside an agent framework. Move the enforcement point; keep the policy.
109+
CPEX enforces policy wherever an agent crosses a trust boundary.
110+
111+
It can run in front of tool servers, beside an agent as an egress sidecar, inside an agent framework, or as middleware between components. The enforcement point can move without changing policy, allowing the same APL configuration to span gateways, agents, and services.
98112

99113
## Install
100114

@@ -162,7 +176,9 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow and [SECURITY.md](S
162176

163177
## Project Status
164178

165-
CPEX is under active development as part of the [ContextForge](https://github.com/contextforge-org) ecosystem. It is designed to work across AI gateways, agent frameworks, LLM proxies, and tool servers.
179+
CPEX is under active development as part of the ContextForge ecosystem.
180+
181+
The project is designed as a reusable enforcement layer for agentic systems, integrating with AI gateways, agent frameworks, LLM proxies, MCP servers, and other capability providers through a common policy model.
166182

167183
## License
168184

docs/content/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ weight: 0
66

77
# CPEX
88

9-
**A policy and authorization framework for agentic applications.**
9+
**A policy enforcement runtime for AI agents.**
1010

11-
CPEX is a deterministic reference monitor between an untrusted agent and the capabilities it invokes. AI agents can be steered by injected content, confused by tool output, or simply make mistakes. CPEX mediates every operation an agent triggers (tool calls, A2A methods, inference calls, prompt and resource fetches) against state the agent cannot see or forge: identity, delegation chains, taint labels, and an append-only audit log.
11+
CPEX is a deterministic reference monitor between an agent and every capability it invokes: tools, prompts, resources, inference providers, and A2A methods. Every operation is evaluated against security state the model cannot observe or influence: identity, delegation chains, information-flow labels, and an append-only audit log.
1212

13-
You write policy in APL (Authorization Policy Language): declarative, attribute-based rules with explicit effects. CPEX evaluates that policy at the boundary and enforces the result, allowing, denying, redacting, delegating, or tainting before the operation proceeds.
13+
Instead of scattering authorization, delegation, redaction, auditing, and information-flow controls across application code, CPEX executes them as a single policy-defined pipeline. APL attaches that pipeline to each entity an agent can invoke and runs it in two phases: before invocation and after the result.
1414

1515
![CPEX mediates every operation an untrusted LLM triggers, evaluating APL policy against identity, delegation, taint, and audit state the model cannot forge](/cpex/images/cpex_overview.png)
1616

17-
The plugin pipeline underneath (hooks, the plugin manager, execution modes) is the mechanism that runs policy effects. It is the supporting layer, not the headline. APL is how you express intent; the pipeline is how that intent executes.
17+
Existing authorization systems (RBAC, ABAC, Cedar, OPA, AuthZEN) answer whether a request should be allowed. CPEX answers a broader question: what security pipeline should execute for this agent operation. It invokes those engines for the decision and enforces the result.
1818

1919
---
2020

docs/content/docs/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ bookFlatSection: true
66

77
# CPEX Documentation
88

9-
CPEX is a policy and authorization framework for agentic applications: a deterministic reference monitor that mediates every operation an untrusted LLM triggers, enforcing policy written in APL (Authorization Policy Language).
9+
CPEX is a policy enforcement runtime for AI agents: a deterministic reference monitor that mediates every operation an untrusted LLM triggers. It runs a policy-defined security pipeline per operation (authorization, delegation, redaction, information-flow control, audit), written in APL (Authorization Policy Language) and attached to each capability an agent can invoke.
1010

1111
Start with the [Vision]({{< relref "/docs/vision" >}}) for the reference-monitor model, the [Quick Start]({{< relref "/docs/quickstart" >}}) to stand up an enforcement point, or [APL]({{< relref "/docs/apl" >}}) to write policy.
1212

docs/content/docs/apl/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ weight: 30
55

66
# Authorization Policy Language
77

8-
APL is how you express policy in CPEX. A policy is declarative: you describe the conditions and the effects, attached to the operation they govern, and CPEX evaluates them at the boundary. You do not write enforcement logic in application code.
8+
APL is how you express policy in CPEX. It is declarative and designed around capabilities rather than requests: every entity an agent can invoke owns its own policy, attached to the operation it governs and evaluated at the boundary. You describe the conditions and the effects; you do not write enforcement logic in application code.
9+
10+
![An APL config: plugins and global settings, then per-entity routes with a pre-invocation flow (require, PDP, delegate, run) and post-invocation result handling (taint, redact), plus session tainting across entities](/cpex/images/apl_overview.png)
911

1012
This page covers the language: routes, phases, predicates, rules, and field pipelines. The rest of this section goes deeper on each kind of policy:
1113

docs/content/docs/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ weight: 10
99

1010
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.
1111

12+
![One agent serves three users across HR, repo, and email backends; CPEX policy produces a different outcome per identity](/cpex/images/demo_scenario.png)
13+
1214
The agent's LLM decides which operation to run. It is untrusted. CPEX sits between it and every capability, and decides what actually happens.
1315

1416
![CPEX mediates every operation an untrusted LLM triggers, evaluating APL policy against identity, delegation, taint, and audit state the model cannot forge](/cpex/images/cpex_overview.png)
1.14 MB
Loading
-28.6 KB
Loading
1.17 MB
Loading

0 commit comments

Comments
 (0)