Structural MoSCoW contracts for deterministic LLM validation.
SAMF provides machine-readable validation contracts for LLMs, translating project management MoSCoW prioritization into strict alignment guards.
Slashes Prompt Instability: Eliminates brittle multi-hop reasoning.Prevents Loop Breaches: Keeps multi-agent reasoning loops from breaking.Optimizes Token Costs: Reduces RAG token waste by enforcing explicit constraints.
from samf import SAMFContract, samf_contract
guard_contract = SAMFContract(
must_have=["JSON", "status", "user_id"],
should_have=["timestamp"],
wont_have=["error", "failed"]
)
@samf_contract(contract=guard_contract)
def call_billing_agent():
return '{"status": "success", "user_id": 4002, "format": "JSON"}'
response = call_billing_agent()
print("Output validated successfully!")
---
**Disclaimer:** This is an independent open-source hobby project developed entirely on personal time and hardware. It is not affiliated with, sponsored by, or endorsed by my employer.