This walkthrough adds a custom predicate to the policy engine and surfaces it in replay.Documentation Index
Fetch the complete documentation index at: https://docs.ameo.agiwithai.com/llms.txt
Use this file to discover all available pages before exploring further.
1. Define the predicate in policy.py
Extend PolicyEngine.validate() with your invariant. Example — block plans when gas exceeds a ceiling:
max_gas_wei to PolicyConfig with a sensible default.
2. Extend GuardrailService (optional)
For checks that need observation context beyond PolicyEngine, add logic in apps/worker/ameo_worker/services/guardrail_service.py → check_plan().
Existing examples: observation quality, balance sufficiency, gas spike, protocol whitelist.
3. Emit structured violations
The graphguardrail node already emits:
4. Surface in replay
cycle_store.py maps guardrail_evaluated events to PolicyCheck rows. New violation codes appear automatically in the Policy validation node when checks fail.
5. Test
tests/test_policy.py (or extend an existing test module) that asserts your predicate blocks an invalid plan.

