# oxdeai/oxdeai architecture

> Architecture diagram of the GitHub repository oxdeai/oxdeai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oxdeai/oxdeai
- Repository: https://github.com/oxdeai/oxdeai
- Video tour (about a minute): https://gitdiagram.com/oxdeai/oxdeai/video

## Overview

OxDeAI is an execution-authorization protocol: an agent proposes an action, the core evaluates intent, state and policy, and an enforcement boundary verifies authorization before allowing execution. The map includes the SDK, framework adapters, replay and audit, independent artifact verification, delegation, Sift receipt handling, and conformance. Edges use README statements or shown imports/calls; unsampled subsystems are represented where the tree or README establishes them, without guessing their internal wiring.

Main entry points: [`packages/core/src/policy/PolicyEngine.ts`](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/policy/PolicyEngine.ts) (Policy Engine), [`packages/guard/src/guard.ts`](https://github.com/oxdeai/oxdeai/blob/main/packages/guard/src/guard.ts) (Guard), [`packages/core/src/verification/verifyAuthorization.ts`](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/verification/verifyAuthorization.ts) (Signature Verification), [`packages/sdk/src/client.ts`](https://github.com/oxdeai/oxdeai/blob/main/packages/sdk/src/client.ts) (SDK Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Decision Core"]
  node_engine["Policy Engine<br/>[PolicyEngine.ts]"]
  node_intent["Intent Model<br/>[intent.ts]"]
  node_hashes["Canonical Hashes<br/>[hashes.ts]"]
  node_audit[("Audit Log<br/>[AuditLog.ts]")]
  node_replay["Replay Engine<br/>[ReplayEngine.ts]"]
end

subgraph group_boundary["Enforcement Boundary"]
  node_guard["Guard<br/>[guard.ts]"]
  node_gateway["PEP Gateway<br/>[gateway.ts]"]
  node_replaystore[("Replay Store<br/>[replayStore.ts]")]
  node_boundaryevent["Boundary Events<br/>[boundaryEvent.ts]"]
end

subgraph group_proof["Artifacts and Verification"]
  node_authorization["Authorization Artifact<br/>[authorization.ts]"]
  node_signatures["Signature Verification"]
  node_snapshot["Snapshots and Envelopes<br/>[CanonicalState.ts]"]
  node_delegation["Delegation"]
end

subgraph group_integrations["SDK and Integrations"]
  node_sdk["SDK Client<br/>[client.ts]"]
  node_cli["CLI<br/>[main.ts]"]
  node_frameworks["Agent Adapters<br/>[adapter.ts]"]
  node_sift["Sift Receipt Flow"]
end

subgraph group_assurance["Conformance"]
  node_conformance["Conformance Suite<br/>[validate.ts]"]
  node_trustedtime["Trusted-Time Checks"]
end

node_agent(("AI Agent"))
node_external["Protected Executor"]

node_agent -->|"proposes action"| node_engine
node_engine -->|"evaluates intent"| node_intent
node_engine -->|"hashes inputs"| node_hashes
node_engine -->|"records decisions"| node_audit
node_engine -->|"issues on allow"| node_authorization
node_sdk -->|"evaluates action"| node_engine
node_sdk -->|"appends events"| node_audit
node_sdk -->|"verifies artifacts"| node_snapshot
node_engine -->|"replays decisions"| node_replay
node_replay -->|"evaluates intents"| node_engine
node_replay -->|"verifies events"| node_audit
node_guard -->|"enforces calls"| node_gateway
node_gateway -->|"checks authorization"| node_guard
node_guard -->|"verifies authorization"| node_signatures
node_guard -->|"checks replay"| node_replaystore
node_guard -->|"emits events"| node_boundaryevent
node_gateway -->|"executes allowed call"| node_external
node_signatures -->|"canonicalizes payload"| node_hashes
node_signatures -->|"verifies artifact"| node_authorization
node_cli -->|"inspects envelope"| node_snapshot
node_cli -->|"verifies envelope"| node_signatures
node_frameworks -->|"adapts framework"| node_guard
node_sift -->|"canonicalizes bindings"| node_hashes
node_conformance -->|"runs checks"| node_trustedtime
node_conformance -->|"validates protocol"| node_engine
node_delegation -.->|"binds authority"| node_authorization

click node_engine "https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/policy/PolicyEngine.ts"
click node_intent "https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/types/intent.ts"
click node_hashes "https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/crypto/hashes.ts"
click node_audit "https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/audit/AuditLog.ts"
click node_replay "https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/replay/ReplayEngine.ts"
click node_authorization "https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/types/authorization.ts"
click node_signatures "https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/verification/verifyAuthorization.ts"
click node_snapshot "https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/snapshot/CanonicalState.ts"
click node_delegation "https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/delegation/createDelegation.ts"
click node_guard "https://github.com/oxdeai/oxdeai/blob/main/packages/guard/src/guard.ts"
click node_gateway "https://github.com/oxdeai/oxdeai/blob/main/packages/guard/src/gateway.ts"
click node_replaystore "https://github.com/oxdeai/oxdeai/blob/main/packages/guard/src/replayStore.ts"
click node_boundaryevent "https://github.com/oxdeai/oxdeai/blob/main/packages/guard/src/boundaryEvent.ts"
click node_sdk "https://github.com/oxdeai/oxdeai/blob/main/packages/sdk/src/client.ts"
click node_cli "https://github.com/oxdeai/oxdeai/blob/main/packages/cli/src/main.ts"
click node_frameworks "https://github.com/oxdeai/oxdeai/blob/main/packages/openclaw/src/adapter.ts"
click node_sift "https://github.com/oxdeai/oxdeai/blob/main/packages/sift/src/receiptToAuthorization.ts"
click node_conformance "https://github.com/oxdeai/oxdeai/blob/main/packages/conformance/src/validate.ts"
click node_trustedtime "https://github.com/oxdeai/oxdeai/blob/main/packages/conformance/src/trustedTimeConformance.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_engine,node_intent,node_hashes,node_audit,node_replay toneBlue
class node_guard,node_gateway,node_replaystore,node_boundaryevent toneAmber
class node_authorization,node_signatures,node_snapshot,node_delegation toneMint
class node_sdk,node_cli,node_frameworks,node_sift toneRose
class node_conformance,node_trustedtime,node_agent,node_external toneIndigo
```

## Components

### Decision Core

- [Policy Engine](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/policy/PolicyEngine.ts): `packages/core/src/policy/PolicyEngine.ts`
- [Intent Model](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/types/intent.ts): `packages/core/src/types/intent.ts`
- [Canonical Hashes](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/crypto/hashes.ts): `packages/core/src/crypto/hashes.ts`
- [Audit Log](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/audit/AuditLog.ts): `packages/core/src/audit/AuditLog.ts`
- [Replay Engine](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/replay/ReplayEngine.ts): `packages/core/src/replay/ReplayEngine.ts`

### Enforcement Boundary

- [Guard](https://github.com/oxdeai/oxdeai/blob/main/packages/guard/src/guard.ts): `packages/guard/src/guard.ts`
- [PEP Gateway](https://github.com/oxdeai/oxdeai/blob/main/packages/guard/src/gateway.ts): `packages/guard/src/gateway.ts`
- [Replay Store](https://github.com/oxdeai/oxdeai/blob/main/packages/guard/src/replayStore.ts): `packages/guard/src/replayStore.ts`
- [Boundary Events](https://github.com/oxdeai/oxdeai/blob/main/packages/guard/src/boundaryEvent.ts): `packages/guard/src/boundaryEvent.ts`

### Artifacts and Verification

- [Authorization Artifact](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/types/authorization.ts): `packages/core/src/types/authorization.ts`
- [Signature Verification](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/verification/verifyAuthorization.ts): `packages/core/src/verification/verifyAuthorization.ts`
- [Snapshots and Envelopes](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/snapshot/CanonicalState.ts): `packages/core/src/snapshot/CanonicalState.ts`
- [Delegation](https://github.com/oxdeai/oxdeai/blob/main/packages/core/src/delegation/createDelegation.ts): `packages/core/src/delegation/createDelegation.ts`

### SDK and Integrations

- [SDK Client](https://github.com/oxdeai/oxdeai/blob/main/packages/sdk/src/client.ts): `packages/sdk/src/client.ts`
- [CLI](https://github.com/oxdeai/oxdeai/blob/main/packages/cli/src/main.ts): `packages/cli/src/main.ts`
- [Agent Adapters](https://github.com/oxdeai/oxdeai/blob/main/packages/openclaw/src/adapter.ts): `packages/openclaw/src/adapter.ts`
- [Sift Receipt Flow](https://github.com/oxdeai/oxdeai/blob/main/packages/sift/src/receiptToAuthorization.ts): `packages/sift/src/receiptToAuthorization.ts`

### Conformance

- [Conformance Suite](https://github.com/oxdeai/oxdeai/blob/main/packages/conformance/src/validate.ts): `packages/conformance/src/validate.ts`
- [Trusted-Time Checks](https://github.com/oxdeai/oxdeai/blob/main/packages/conformance/src/trustedTimeConformance.ts): `packages/conformance/src/trustedTimeConformance.ts`

### Other components

- **AI Agent**
- **Protected Executor**

## Connections

- AI Agent → Policy Engine: proposes action (evidence: `README.md`)
- Policy Engine → Intent Model: evaluates intent (evidence: `packages/core/src/policy/PolicyEngine.ts`)
- Policy Engine → Canonical Hashes: hashes inputs (evidence: `packages/core/src/policy/PolicyEngine.ts`)
- Policy Engine → Audit Log: records decisions (evidence: `packages/core/src/policy/PolicyEngine.ts`)
- Policy Engine → Authorization Artifact: issues on allow (evidence: `README.md`)
- SDK Client → Policy Engine: evaluates action (evidence: `packages/sdk/src/client.ts`)
- SDK Client → Audit Log: appends events (evidence: `packages/sdk/src/client.ts`)
- SDK Client → Snapshots and Envelopes: verifies artifacts (evidence: `packages/sdk/src/client.ts`)
- Policy Engine → Replay Engine: replays decisions (evidence: `packages/core/src/replay/ReplayEngine.ts`)
- Replay Engine → Policy Engine: evaluates intents (evidence: `packages/core/src/replay/ReplayEngine.ts`)
- Replay Engine → Audit Log: verifies events (evidence: `packages/core/src/replay/ReplayEngine.ts`)
- Guard → PEP Gateway: enforces calls (evidence: `README.md`)
- PEP Gateway → Guard: checks authorization (evidence: `README.md`)
- Guard → Signature Verification: verifies authorization (evidence: `packages/guard/src/guard.ts`)
- Guard → Replay Store: checks replay (evidence: `packages/guard/src/guard.ts`)
- Guard → Boundary Events: emits events (evidence: `packages/guard/src/guard.ts`)
- PEP Gateway → Protected Executor: executes allowed call (evidence: `README.md`)
- Signature Verification → Canonical Hashes: canonicalizes payload (evidence: `packages/core/src/verification/verifyAuthorization.ts`)
- Signature Verification → Authorization Artifact: verifies artifact (evidence: `packages/core/src/verification/verifyAuthorization.ts`)
- CLI → Snapshots and Envelopes: inspects envelope (evidence: `packages/cli/src/main.ts`)
- CLI → Signature Verification: verifies envelope (evidence: `packages/cli/src/main.ts`)
- Agent Adapters → Guard: adapts framework (evidence: `packages/openclaw/src/adapter.ts`)
- Sift Receipt Flow → Canonical Hashes: canonicalizes bindings (evidence: `packages/sift/src/receiptToAuthorization.ts`)
- Conformance Suite → Trusted-Time Checks: runs checks (evidence: `packages/conformance/src/validate.ts`)
- Conformance Suite → Policy Engine: validates protocol (evidence: `packages/conformance/src/validate.ts`)
- Delegation → Authorization Artifact: binds authority
