# SAMF- Deterministic Moscow guardrails for LLM multi-agent loops

> Source: <https://github.com/NanoPrompt/samf-framework>
> Published: 2026-06-16 06:00:55+00:00

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.

``` python
from samf import SAMFContract, samf_contract

# Define your strict execution contract
guard_contract = SAMFContract(
    must_have=["JSON", "status", "user_id"],
    should_have=["timestamp"],
    wont_have=["error", "failed"]
)

# Enforce it seamlessly with a decorator
@samf_contract(contract=guard_contract)
def call_billing_agent():
    # Your LLM generation / LangGraph node logic here
    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.
```


