Skip to content

# Live Demo

Click Next to walk through: define a rule (max $500), set up an agent, try an allowed transfer ($300), try a blocked transfer ($600), then verify the log.

1. Covenant 2. Setup 3. Allowed 4. Blocked 5. Verify
nobulex covenant-demo

Step 1: We define a rule: transfers up to $500 are allowed; anything over $500 is forbidden.

> covenant SafeTrader { permit transfer (amount <= 500); forbid transfer (amount > 500); }

Step 2: We create an agent and wrap it with middleware. Every action the agent tries will be checked against the covenant before it runs.

> const agent = await createDID();
> const mw = new EnforcementMiddleware({ agentDid: agent.did, spec });

Step 3: Agent tries to transfer $300. That's under $500, so middleware allows it and adds an entry to the log.

> mw.execute({ action: 'transfer', params: { amount: 300 } }, ...)
← ALLOWED — within covenant
Log: { action: "transfer", amount: 300, result: "allowed", hash: "0x2b..." }

Step 4: Agent tries to transfer $600. Over the limit — middleware blocks it. The transfer never executes. The block is logged.

> mw.execute({ action: 'transfer', params: { amount: 600 } }, ...)
← BLOCKED — covenant: amount > 500
Callback never runs. Log: { action: "transfer", amount: 600, result: "blocked", hash: "0x7a..." }

Step 5: Anyone can run `verify()` on the log. No need to trust the operator — the proof is in the data.

> verify(spec, mw.getLog())
← { compliant: true, violations: [] } ✓
Run real demo on your machine → ← Home demo Questions? nobulex.dev@gmail.com