Guardian Engine — API & MCP Integration Guide
A deterministic oracle inside your agent's generate→verify loop. Your LLM authors the recipe; Guardian judges it. Guardian Engine catches hallucinated temperatures, missing techniques, wrong ingredients, and impossible cooking steps before they reach the pan — and returns machine-actionable patches so your agent can fix exactly what's wrong. Recipes are the first vertical — the same deterministic approach generalises to any procedural domain where correctness matters.
Why an oracle instead of another LLM critique? An LLM critique is a sample — it misses differently on every run. Guardian's symbolic engine makes guarantees a generative model structurally cannot:
- Exhaustive checking — every rule is evaluated on every call, not a sample of them.
- Certified negatives — "no EU Annex II allergen source detected" is an absence claim an LLM cannot make.
- Replayable verdicts — same input + same spec + same knowledge-base version → byte-identical output. Every response pins
kb_version_hash and master_hash so any verdict is reproducible as an audit record.
- Machine-actionable repair — findings come with structured
patches (and fix_recipe can apply them deterministically); your agent authors the rest and re-verifies.
- Bring your own spec — verify against your house recipe or SOP via
master_json, not just the bundled catalog.
[Official MCP Registry] [Install with Smithery] [Glama.ai MCP Server]
Endpoint: https://api.kaimeilabs.dev/mcp
Transport: Streamable HTTP (MCP)
Auth: None — free during early access (fair use applies)
⚠️ Safety & Liability Notice
Guardian Engine is an automated, informational recipe-verification tool. It is not a
food-safety, medical, nutritional, or regulatory-compliance authority, and its output is not
professional advice.
- Allergens are not guaranteed. Allergen warnings (including
check_safety,
check_allergens, and the allergens field of every verification response) come from an
automated knowledge base that may be incomplete or wrong. A PASSED verdict or an empty
allergen list is NOT a guarantee that a recipe is free of any allergen or safe for any
individual. Never rely on Guardian to decide whether a food is safe for someone with a
food allergy or intolerance — always verify against the actual ingredient/product labelling
and consult a qualified professional.
- Dietary and religious claims are not certifications.
verify_dietary_claim results
(vegan, vegetarian, gluten-free, dairy-free, nut-free, halal, kosher) are automated
ingredient-level checks — they are not a substitute for certification by a recognised
dietary or religious authority.
- Repaired recipes are not certified safe.
fix_recipe output must be reviewed by a human
before being cooked, served, or published; allergen findings are never auto-fixed and a
repaired recipe may still fail verification.
- Cooking-safety findings are informational and must not replace certified guidance (e.g.
USDA, EU FIC, or your local food-safety authority).
- No warranty. The Service is provided "AS IS", without warranty of any kind. To the maximum
extent permitted by law, Kaimei Labs accepts no liability for any loss, injury, or damage
arising from use of, or reliance on, Guardian output.
Use of the API constitutes acceptance of the full Terms of Service
(warranty disclaimer, limitation of liability, indemnification).
Connect Your Agent
Guardian is a hosted MCP server. No install, no API key, no Docker. Pick your client and paste the config.
Claude Desktop
Add to your claude_desktop_config.json:
Restart Claude Desktop. Ask: "List the available dishes in Guardian Engine" to confirm.
Cursor
Open Settings → MCP Servers → Add new MCP server, then paste:
VS Code (GitHub Copilot)
Add to your .vscode/mcp.json (or user settings.json under "mcp"):
Windsurf
Add to your Windsurf MCP config:
Smithery (One-Click)
[Install with Smithery] — auto-configures Claude Desktop, Cursor, and more.
[!WARNING]
Smithery Proxy Limitation: The default Smithery proxy URL (guardian-engine--kaimeilabs.run.tools) does not support Streaming HTTP and will silently fail. You MUST edit your MCP config after installation to use the direct endpoint: https://api.kaimeilabs.dev/mcp.
Glama.ai
Guardian Engine is also listed on Glama.ai — discover and connect to MCP servers from the Glama directory.
Any MCP Client (Python SDK)
Tools
The MCP server exposes seven tools. verify_recipe is the core loop; the rest support the compare → verify → repair cycle and master-independent safety checks.
verify_recipe
Verify a candidate recipe against a Guardian master spec. Returns a structured report with a strict PASSED/FAILED verdict (no scores) and detailed findings, each citing the rule it violated. The verdict is policy-driven: any CRITICAL finding fails the recipe; more than 5 WARNINGs also fail.
Tip — include the original prompt for personalised feedback: When you include original_prompt (e.g. "Make a spicy vegan rendang"), Guardian matches findings to the user's stated dietary needs and flavour preferences, and activates audience-sensitive safety checks (e.g. flagging honey in recipes for infants, raw egg for pregnant users). Without it, Guardian still returns the full verdict and all findings.
Unknown dish? If the dish isn't in the catalog, the UNKNOWN_DISH error carries a safety_fallback verdict — the master-independent safety layer (poultry temperature + allergen scan) still runs, so your agent always leaves with deterministic value.
Field audience: issue is a machine-readable code for programmatic handling — don't show it to end users. Use title and suggested_correction as the user-facing fields.
fix_recipe
Deterministically repair a candidate recipe against a master spec. Verifies, applies every machine-actionable patch the symbolic engine produced (missing ingredients, quantities, temperatures, durations, cooking media, substitutions), then re-verifies. No LLM is involved — the repair is a deterministic function of the candidate and the ruleset.
The response reports verdict_before → verdict_after, fully_fixed, patches_applied, patches_skipped, unresolved_findings, and the fixed_recipe. Changes that need recipe-authoring judgement (adding a whole cooking phase, rewriting instructions, ratio rebalancing) are not auto-applied — they're returned under patches_skipped, with add_step patches carrying a suggested_step template from the master for your agent to author in the recipe's own voice and re-verify. Allergen findings are never auto-fixed. Do not assume a fixed recipe will pass — check verdict_after.
list_dishes
List all master recipes Guardian can verify against, with rich metadata (slug, title, cuisine, region, aliases, complexity).
get_master
Return the canonical master recipe for a dish — a pure knowledge-base lookup, no LLM. Enables compare-then-verify loops: fetch the master, diff it against your recipe, then call verify_recipe instead of verifying blind. Master content is transparent by default: exact temperatures, timings, and EU FIC 1169/2011 allergen codes are returned verbatim. Also the live reference for the master_json schema when bringing your own master.
check_safety
Master-independent safety checks for any recipe — no dish resolution or master spec required. Checks poultry internal-temperature safety (≥ 74 °C) and scans all ingredients against the 14 EU FIC 1169/2011 Annex II allergen groups. Use it when verify_recipe has no matching master.
check_allergens
Check an ingredient list for EU FIC 1169/2011 allergen presence, with a detailed audit trace mapping each ingredient to its Annex II allergen group (entry numbers and labels included).
verify_dietary_claim
Verify that a recipe satisfies a dietary claim, returning a structured verdict with the specific offending ingredients — never a vague paraphrase.
Bring Your Own Master (master_json)
The bundled catalog is a reference library — the primary production pattern is verifying against your own spec: a house recipe, a franchise SOP, a test kitchen's canonical version. Pass master_json to verify_recipe or fix_recipe (same schema as catalog masters — call get_master for a live example: title, serves, ingredients[], required_ingredients[] with substitute tiers, steps[] with technique/temperature/duration/medium).
- When
master_json is supplied, dish_name may be omitted and the catalog is bypassed entirely — the candidate is checked against your spec.
- The response pins the spec:
master_source: "user" and master_hash (sha256 over the canonical master). Together with kb_version_hash, this makes every verdict replayable: anyone holding the same candidate, spec, and KB version reproduces the byte-identical result.
- Malformed masters return a structured
INVALID_MASTER error, not a server error. Max 500 KB.
Available Recipes (161 dishes, 5 regions)
All recipes accept multiple aliases (e.g. "rendang", "tikka-masala", "risotto", "bourguignon", "carbonara"). Use list_dishes for the full live catalog.
Missing a Dish?
The catalog is regularly expanding. If your agent requires verification for a dish not currently supported, please open an issue on GitHub to request it. We prioritize additions based on developer demand.
Example Verification Output
What does a Guardian verification report actually look like? Here's the (abridged) response_format: "json" structure when an agent submits a carbonara made with bacon, cream, and an overheated pan:
Each finding carries a severity, a justification grounded in culinary science, and machine-readable details — and the patches array tells your agent exactly what change would resolve each fixable finding, so it repairs only what's wrong instead of regenerating and guessing. kb_version_hash + master_hash pin the exact knowledge-base and spec versions the verdict was computed against, making the result replayable as an audit record.
Patch actions: add_ingredient, replace_ingredient, set_quantity, adjust_quantity, set_temperature, set_duration, set_medium, and add_step (which includes a suggested_step template for your agent to author, then re-verify).
Files in This Repository
Data & Privacy
- No PII collected — we do not store user names, emails, or API keys. Underlying cloud infrastructure may temporarily process IP addresses for routing.
- Data for Compute Exchange — the free service is provided in exchange for usage data. Submitted recipes are used to improve verification accuracy and create anonymized derived datasets. See our Terms of Service.
- Do not include PII in recipe payloads.
- Fair use quotas enforced via compute limits.
[!CAUTION]
Not a Substitute for Food Safety Knowledge
While Guardian Engine catches explicitly dangerous AI hallucinations (like serving poultry below safe temperatures), it cannot guarantee a recipe is 100% safe to consume. Pathogen destruction relies on variables (time, mass, equipment) that text-based AI models cannot perfectly control. Verification results are informational and must always be paired with human common sense and standard kitchen safety practices.
Support & Contact
Building an AI cooking assistant, smart kitchen platform, or agentic food-tech product? We'd love to hear from you.
License
Client code in this repository (client.py, test_integration.py) is released under the MIT License. The Guardian Engine verification logic and master recipe datasets are proprietary.