Summary
Add economic.policies section to World Manifest v2 schema: bind budget limits to roles, provenance classes, and task types. Compile into CompiledPolicy and enforce alongside capability and provenance checks.
Depends on: #122 (runtime enforcement wiring)
Scope
economic.policies YAML section with conditions: role, provenance_class, task_type, trust_level
- Examples:
untrusted input provenance → strict budget (e.g. $0.01 per request)
trusted workflow role → higher budget (e.g. $1.00 per request)
external_document taint → deny any LLM call above p50 estimate
- Compile policies into
CompiledPolicy artifact (no YAML access at runtime)
- Evaluate alongside capability and provenance checks at IR construction time
- All budget decisions appear in audit trace with matched policy ID
Key Files
manifests/schema_v2.yaml — add economic.policies section
src/agent_hypervisor/compiler/loader_v2.py — parse policy conditions
src/agent_hypervisor/compiler/emitter.py — emit compiled budget policies
src/agent_hypervisor/economic/economic_policy.py — EconomicPolicyEngine (extend for role/provenance conditions)
tests/compiler/test_economic_policies.py — new test file
tests/runtime/test_invariants.py — role-differentiated budget invariant
Acceptance Criteria
Milestone
v0.3
Summary
Add
economic.policiessection to World Manifest v2 schema: bind budget limits to roles, provenance classes, and task types. Compile intoCompiledPolicyand enforce alongside capability and provenance checks.Depends on: #122 (runtime enforcement wiring)
Scope
economic.policiesYAML section with conditions:role,provenance_class,task_type,trust_leveluntrustedinput provenance → strict budget (e.g. $0.01 per request)trustedworkflow role → higher budget (e.g. $1.00 per request)external_documenttaint → deny any LLM call above p50 estimateCompiledPolicyartifact (no YAML access at runtime)Key Files
manifests/schema_v2.yaml— addeconomic.policiessectionsrc/agent_hypervisor/compiler/loader_v2.py— parse policy conditionssrc/agent_hypervisor/compiler/emitter.py— emit compiled budget policiessrc/agent_hypervisor/economic/economic_policy.py—EconomicPolicyEngine(extend for role/provenance conditions)tests/compiler/test_economic_policies.py— new test filetests/runtime/test_invariants.py— role-differentiated budget invariantAcceptance Criteria
pytest tests/compiler/test_economic_policies.py tests/runtime/test_invariants.py -vpassesMilestone
v0.3