Skip to content

Add Vibes-Coded Observer middleware example (x402 guard gates before settle)#20

Open
doteyeso-ops wants to merge 3 commits into
AetherCore-Dev:mainfrom
doteyeso-ops:feat/vibes-coded-observer
Open

Add Vibes-Coded Observer middleware example (x402 guard gates before settle)#20
doteyeso-ops wants to merge 3 commits into
AetherCore-Dev:mainfrom
doteyeso-ops:feat/vibes-coded-observer

Conversation

@doteyeso-ops

Copy link
Copy Markdown

Summary

Adds examples/vibes_coded_observer.py — a drop-in Observer that screens an agent's irreversible actions (payments, transfers, stateful writes) against Vibes-Coded's hosted x402 pay-per-call guard APIs before ag402 settles them.

Because ag402_core.enable() already auto-pays any HTTP 402, the guard calls need zero payment code — ag402 transparently settles the tiny per-call USDC fee.

How it fits the ag402 / Observer split

  • ag402 = Money Layer (deterministic settlement)
  • Observer = Trust Layer (pre-action reliability + replay protection)
  • Vibes-Coded guards = the evidence source a governance/observer stack calls per action

Guard mapping (all live endpoints):

Action intent Guard
payment_or_transfer / idempotent_call idempotency-guard
stateful_action agent-state-guard
external_write memory-exfil-guard
value_transfer rate-limit-guard

A guard returning allowed: false blocks the action (fail-closed). Uses the sandbox key from AG402_SANDBOX_KEY (thanks @BTCBoyd for the key in #4).

Test plan

  • Syntax valid; all referenced guard slugs verified against the live catalog
  • pip install ag402-core httpx && AG402_SANDBOX_KEY=... python examples/vibes_coded_observer.py

Happy to adjust the guard→intent mapping or wire it into the existing integration examples (LangChain/CrewAI/Autogen) if you'd like it as a first-class reference integration.

@doteyeso-ops

Copy link
Copy Markdown
Author

@AetherCore-Dev @BTCBoyd @0xAllenDev — bumping for review. This adds examples/vibes_coded_observer.py: an ag402 Observer middleware that wraps gateway actions and routes irreversible ones (payment/transfer/stateful) through an external reliability layer before settle. It's a concrete integration showing how ag402 handles settlement while a peer handles trust — the synergy you described. The example is self-contained, references only public endpoints, and the sandbox key from BTCBoyd can be wired via env. Happy to adjust style/scope to match the repo. Merging this gives ag402 users a drop-in trust gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant