Repository navigation
Description
What is wrong
Contributor: Raghuvar Durga (@drk-ram)
On main (a7f0858), prototype/manifest_requirements.py (combine_requirements) has two defects when combining a verified Agent Manifest's evidence_requirements with local relying-party Requirements:
-
Multi-method
required_bindings.accepted_methodsis expanded into simultaneous binding requirements instead of intersecting with local policy:- In
combine_requirements(lines 49-58):bindings = { (b.source, b.target, b.relationship, b.method): b.model_dump() for b in local.bindings } for declared in verified.requirements.required_bindings: for method in declared.accepted_methods: key = (declared.source, declared.target, declared.relationship, method) bindings[key] = { "source": declared.source, "target": declared.target, "relationship": declared.relationship, "method": method, }
- In Agent Manifest (
evidence-requirements-experimental-v1),required_bindings[].accepted_methodsis the list of relationship methods the manifest accepts for(source, target, relationship)(analogous toaccepted_profileson components). - However,
combine_requirementsloops overfor method in declared.accepted_methods:and adds every method inaccepted_methodsas a separate required binding inRequirements.bindings! - Worse still:
- If local policy already requires
(source, target, "same-workload", "same-evidence-v1")and the manifest declaresaccepted_methods: ["same-instance-v1"],combine_requirementsadds"same-instance-v1"alongside"same-evidence-v1"instead of detecting that the manifest and local policy have disjoint accepted methods (manifest_requirement_untrusted) or selecting the stricter method (same-evidence-v1>same-instance-v1)! - If the manifest declares
accepted_methods: ["same-instance-v1", "same-evidence-v1"],combine_requirementsrequires the token to carry both bindings simultaneously for the same(source, target)pair!
- If local policy already requires
- In
-
Unconfigured binding endpoints (
source/target) or invalid binding methods leak raw PydanticValidationErrorinstead ofProfileError:- If
verified.requirements.required_bindingsnames asourceortargetcomponent that is not inlocal.components(orsource == target, or an unsupportedmethod/relationship),v.Requirements.model_validate(...)at line 59 raises a raw PydanticValidationErrorinstead ofv.ProfileError("manifest_component_unconfigured")/v.ProfileError("manifest_requirement_untrusted").
- If
Spec section or file
prototype/manifest_requirements.py(combine_requirements)tests/test_manifest_requirements_bridge.py
Expected behavior
- In
combine_requirements:- Validate that every declared binding's
sourceandtargetexist inlocal_by_id(andsource != target), raisingv.ProfileError("manifest_component_unconfigured")when a binding references an unconfigured component. - Validate that
declared.accepted_methodscontains at least one supported method ({"same-instance-v1", "same-evidence-v1"}); if a local binding already exists for(source, target, relationship)and itsmethodis not indeclared.accepted_methods, check whether tightening is possible (e.g.,"same-evidence-v1"is strictly stronger than"same-instance-v1"; if the intersection/tightening is empty or incompatible, raisev.ProfileError("manifest_requirement_untrusted")), and emit at most oneBindingRequirementper(source, target, relationship)choosing the strongest required method ("same-evidence-v1"over"same-instance-v1"). - Wrap any final
ValidationErrorasv.ProfileError.
- Validate that every declared binding's
Impact
Prevents combine_requirements from turning a manifest's accepted_methods alternatives into impossible simultaneous binding requirements or leaking unhandled Pydantic ValidationError exceptions on unconfigured binding endpoints.
Activity
prototype(manifest_requirements): resolve accepted_methods and valida…