What an Adapter Does
The adapter is a governance-to-native-config compiler. It takes r5e’s governed session spec and projects it into whatever format the provider expects:| r5e Input | Claude Code Output | Codex Output | API Output |
|---|---|---|---|
| Policy grants | .claude/settings.json | --sandbox flags | tool definitions |
| Context layers | CLAUDE.md | system prompt | system message |
| Tool refs | .claude/skills/*.md | tool flags | tools array |
| Gateway config | MCP server config | N/A | base URL |
| Credential leases | env vars (v1alpha) | env vars | auth headers |
| Workspace claims | git worktree | -C workdir | N/A |
Adapter Classes
Not all adapters have the same fidelity:| Class | Enforcement | Event Fidelity | Example |
|---|---|---|---|
| opaque-cli | Pre-flight + observe-and-terminate | Partial (post-hoc observation) | Claude Code, Codex, Gemini CLI |
| governed-api | Synchronous per-call enforcement | Full | Direct API adapters |
| governed-mcp | MCP protocol-native enforcement | Full | MCP gateway adapters |