Deterministic execution authorization for AI agents.
No authorization → no execution.
The decision and the execution are separate. That separation is the guarantee.
The PolicyEngine (PDP) decides. The Guard (PEP) enforces. The Verifier checks trust. Execution is impossible without authorization.
Agents can call APIs, provision infrastructure, move money. You need a boundary that holds before any side effect occurs.
Properties derived directly from the protocol spec and conformance tests.
(intent, state, policy) inputs produce identical outputs
across runtimes, restarts, and replicas. Policy-critical logic
has no ambient randomness or shared mutable state.
trustedKeySets must be configured by the verifier.
In strict mode, missing key sets → TRUSTED_KEYSETS_REQUIRED.
A valid signature from an unknown issuer still fails closed.
verifyEnvelope) with state snapshots
and event sequences.
An agent proposes the same action twice. Executed exactly once. Replay is blocked at the boundary before any side effect.
verifyEnvelope() → ok
— audit trail verified offline after the run.
One function intercepts all proposed actions. Execution only proceeds if the policy allows it.
import { PolicyEngine } from "@oxdeai/core";
import { OxDeAIGuard, OxDeAIDenyError } from "@oxdeai/guard";
// 1. Initialize the policy engine
const engine = new PolicyEngine({
policy_version: "v1.0.0",
engine_secret: process.env.OXDEAI_ENGINE_SECRET,
authorization_ttl_seconds: 60,
policyId: "policy-production-v1",
});
// 2. Create a guard — the Policy Enforcement Point
const guard = OxDeAIGuard({
engine,
getState: () => getAgentState(),
setState: (s) => setAgentState(s),
trustedKeySets: [myKeySet], // trust is explicit, not implicit
onDecision: (record) => auditLog(record),
});
// 3. Every action goes through the guard
try {
await guard(
{
name: "charge_wallet",
args: { amount: 100, currency: "usd" },
context: { agent_id: "agent-001" },
},
async () => chargeWallet(100) // only runs if ALLOW
);
} catch (err) {
if (err instanceof OxDeAIDenyError) {
// DENY — execution did not occur
}
}
import { verifyAuthorization, createVerifier } from "@oxdeai/core";
// Inline: strict mode requires trustedKeySets
const result = verifyAuthorization(artifact, {
mode: "strict",
trustedKeySets: [myKeySet],
expectedPolicyId: "policy-production-v1",
});
// A valid signature from an unknown issuer → still fails closed
// Missing trustedKeySets in strict mode → TRUSTED_KEYSETS_REQUIRED
// Bound verifier: pre-configure trust once, reuse everywhere
const verifier = createVerifier({
trustedKeySets: [myKeySet], // required, non-empty
expectedIssuer: "oxdeai-pdp",
});
// Verify envelope produced by the engine after a run
const envelopeResult = verifyEnvelope(envelopeBytes, {
mode: "strict",
trustedKeySets: [myKeySet],
expectedPolicyId: "policy-production-v1",
});
if (envelopeResult.status === "ok") {
// audit trail is intact and cryptographically verified
}
import { createDelegation, verifyDelegationChain } from "@oxdeai/core";
// Parent agent delegates narrowed authority to a child agent
const delegation = createDelegation(parentAuth, {
delegatee: "child-agent-002",
scope: {
tools: ["provision_gpu"],
max_amount: 300n, // strictly narrowed from parent
},
expiry: parentAuth.expiry, // cannot exceed parent
kid: "key-001",
privateKey: signingKey,
});
// Child verifies full chain before execution
const chainResult = verifyDelegationChain(delegation, parentAuth, {
now: Math.floor(Date.now() / 1000),
trustedKeySets: [myKeySet],
requireSignatureVerification: true,
consumedDelegationIds: usedIds, // replay prevention
});
if (chainResult.ok) {
// execute within delegated scope
}
OxDeAI enforces the execution boundary. Who is trusted is defined outside the protocol, by the verifier.
| Concept | Controlled by | Notes |
|---|---|---|
| Issuer | Any system | Policy engine, delegation service, or any custom authority can sign artifacts. |
| Trusted keys | The verifier — trustedKeySets |
Explicitly configured by the relying party. Not inferred from the artifact itself. |
| Signature validity | Cryptographic | Proves the artifact was not tampered with. Does not confer trust to the issuer. |
| Execution gate | OxDeAI | Enforced after trust is established. Fail-closed by design in strict mode. |
| Strict mode without keys | Fails closed | TRUSTED_KEYSETS_REQUIRED — no implicit trust, ever. |
All adapters delegate to @oxdeai/guard.
Identical inputs produce identical authorization decisions across all of them.
Cross-adapter conformance validated in CI: same intent + state + policy → same decision across all adapters.