Bolt Foundry Gambit: Build Trustworthy AI Agents with TDD-for-Agents
System Core Intelligence
The Bolt Foundry Gambit: Build Trustworthy AI Agents with TDD-for-Agents workflow is an elite agentic system designed to automate developer tools operations. By leveraging autonomous AI agents, it significantly reduces manual overhead, saving approximately 15-20 hours per week while ensuring high-fidelity output and operational scalability.
Byline
By Deepak Bagada, CEO at SaaSNext Deepak has built inspection-grade AI agent systems serving over 50,000 production agent executions and developed verification frameworks for trustworthy agent deployments using typed-step architectures, trace evidence capture, and automated grading pipelines across Mastra, LangGraph, and CrewAI ecosystems.
Editorial Lede
Every AI agent framework shipping today solves the same two problems: connecting LLM calls to tools and persisting conversation state. They do not solve the problem that keeps agents out of production — the problem of trust. When an agent calls a write_file tool and produces a side effect, you have no guarantee the file content is correct. When it executes a SQL query against your production database, you cannot prove it selected the right WHERE clause. When it charges a customer via the billing API, you lack the evidence chain to audit the decision. The industry has focused on making agents capable when it should have focused on making agents accountable. On May 15, 2026, Bolt Foundry released Gambit v1.0.0 under the MIT license, an open-source foundation and runtime for building trustworthy, inspectable AI agents. Gambit introduces typed steps with explicit inputs and outputs enforced through Zod schemas, reusable graders that evaluate step outputs against expected criteria, scenario generation that produces test harnesses from natural-language specifications, and trace evidence capture that records every decision, tool call, permission grant, and token expenditure into a replayable evidence ledger. The runtime is local-first and starts with a single command: npx @bolt-foundry/gambit serve launching the Simulator at http://localhost:8000, where you build, test, grade, and verify agents before they ever touch production. It integrates with Mastra, LangGraph, OpenAI Agents SDK, CrewAI, and Google ADK, wrapping their agents in Gambit's verification layer. This is TDD for AI agents — verification as a first-class citizen rather than an afterthought. Here is how it works, why it matters, and how to adopt it today.
What Is Bolt Foundry Gambit
Bolt Foundry Gambit is an open-source verification runtime and foundation for building AI agents that produce verifiable, inspectable, and replayable outputs. Gambit is written in TypeScript and distributed under the MIT license. It wraps existing agent frameworks — Mastra, LangGraph, OpenAI Agents SDK, CrewAI, and Google ADK — with a typed-step architecture that enforces input and output schemas at runtime using Zod. Every step an agent executes is defined as a TypedStep with a name, a description, an input schema, an output schema, and an optional grader. The grader is a function or LLM-as-judge call that evaluates whether the step output meets the expected criteria and returns a Grade with a score, a verdict of pass, fail, or partial, and an evidence string explaining the reasoning. Agents run inside the Gambit Simulator, a local web interface that displays the live execution graph with every step's inputs, outputs, grades, token usage, permission grants, and timing metadata. The Simulator exposes a Replay button that re-executes the agent with the same trace, enabling deterministic debugging of non-deterministic LLM behavior. Gambit also generates scenario files — declarative test specifications that describe an input, expected outcomes, grading criteria, and permission boundaries — which can be run in CI as regression suites. When a trace fails in production, Gambit captures the full evidence ledger and converts it into a regression test so the same failure cannot recur without being caught.
[!NOTE] Gambit is not a replacement for Mastra, LangGraph, or CrewAI. It is a verification layer that wraps those frameworks. You keep your existing agent definitions, tool registrations, and orchestration logic. Gambit adds typed-step enforcement, grading, scenario generation, and trace evidence capture on top.
The project is available on GitHub under the MIT license. The runtime is published on npm as @bolt-foundry/gambit. The Simulator runs entirely locally with no data leaving your machine unless you configure remote telemetry. Bolt Foundry also publishes a hosted cloud tier called Bolt Foundry Cloud for teams that want shared scenario libraries, centralized evidence dashboards, and CI integration without self-hosting the Simulator infrastructure.
The Problem in Numbers
STAT: "In a study of 1,000 production agent executions across Mastra and LangGraph deployments, 23.4% of tool call outputs contained at least one schema violation — a missing required field, a type mismatch, or an out-of-range value — that went undetected because the framework did not enforce output schemas at runtime." — Bolt Foundry Internal Audit, April 2026
For the past two years, teams building AI agents have focused on capability benchmarks: how many tool calls an agent can chain, how many tokens it can process, how many steps it can complete before hallucinating. These metrics measure what an agent can do, not what an agent can be trusted to do. The consequence is that agents in production produce side effects — file writes, database mutations, API calls — that are not validated against expected outcomes. A write_file call succeeds, but the file content is syntactically valid and semantically wrong. A queryDatabase tool executes, but the SQL contains an off-by-one in the LIMIT clause that returns incorrect results. A sendEmail tool dispatches, but the recipient list includes a user who should have been excluded. Without typed-step enforcement, these errors propagate silently. Without graders, there is no automated mechanism to detect them. Without trace evidence, there is no way to reconstruct the decision chain after the fact. The industry has built powerful agent capabilities on a foundation of zero verification infrastructure.
PROOF: In Bolt Foundry's published benchmarks using a customer-support agent built on Mastra with 12 tool calls per conversation turn, Gambit's typed-step layer added an average of 47 milliseconds of schema validation overhead per step and 180 milliseconds per LLM-as-judge grader invocation on a MacBook Pro M3 Max. The total verification overhead per agent turn was 2.1 seconds for a full grade-every-step configuration, versus 0.3 seconds for a sample-grade-every-5-steps configuration. The graded configuration caught 19 schema violations and 7 semantic errors across 200 test conversations that the unverified agent produced without detection. In a separate study using a LangGraph-based code review agent, Gambit's trace evidence capture logged an average of 3,400 tokens per conversation turn including full tool call inputs, outputs, grader verdicts, permission grant decisions, and timing metadata. The replay feature successfully reproduced 97 of 100 non-deterministic failures, with the remaining 3 failures attributed to external API rate limits that were not captured in the trace.
[!WARNING] LLM-as-judge graders are themselves non-deterministic. A grader using GPT-4o may return different verdicts for the same input on different invocations. Bolt Foundry recommends using deterministic graders (function-based or rule-based) for critical verification paths and using LLM-as-judge graders only as a secondary signal. Always pin the grader model version and temperature settings, and run graders at least three times with majority voting when the verdict determines a production deployment gate.
What This Workflow Does
This workflow sets up Bolt Foundry Gambit on your local machine, defines a typed agent with Zod-enforced steps, runs the agent in the Gambit Simulator with live grading, generates scenario files for CI regression testing, and captures trace evidence for audit and replay debugging. You will build a verifiable customer-support triage agent from scratch, see how typed steps catch schema violations before they reach production, and set up automated grading that blocks regression merges when agents produce unexpected outputs.
[TOOL: Gambit CLI (gambit)] Role: CLI binary that handles project initialization, agent execution, Simulator server management, and scenario test execution. What it decides: Selects the agent framework adapter (Mastra, LangGraph, OpenAI SDK, CrewAI, Google ADK) based on your project configuration, initializes the typed-step registry with Zod schemas, manages the trace evidence store in the local .gambit directory. Output: Agent execution traces with full step-by-step inputs, outputs, grades, and metadata written to the local evidence store; streaming execution graph updates to the Simulator WebSocket; pass/fail verdicts for CI scenario runs.
[TOOL: Gambit Simulator (Web UI)] Role: Local web-based execution graph viewer, debugger, and scenario authoring environment. What it decides: Renders the live agent execution graph with step status indicators (pending, running, passed, failed, skipped), exposes replay controls for deterministic re-execution from the trace, provides a scenario editor for writing declarative test specifications. Output: Interactive web interface at http://localhost:8000 with real-time WebSocket updates from the running agent, visual step-by-step trace navigation, and exportable evidence packets in JSON format.
[TOOL: @bolt-foundry/gambit SDK (npm package)] Role: TypeScript SDK that provides the TypedStep, Agent, Grader, Scenario, and Evidence classes for programmatic agent definition and verification. What it decides: Enforces input and output schemas at runtime using Zod, invokes grader functions after each step execution, collects trace evidence including token usage and permission grants, and replays agents from stored traces for deterministic debugging. Output: TypedStep instances with validated inputs and outputs, Grade objects with score-verdict-evidence triples, EvidenceLedger objects containing the full execution trace, and execution replay streams for deterministic debugging.
What We Found When We Tested This
We deployed Bolt Foundry Gambit v1.0.0 on a MacBook Pro M3 Max with 36 GB unified memory running macOS 15.5 and Node.js 22. Our test agent was a customer-support triage agent built on Mastra 0.8.2 with 12 tool calls per conversation turn: classifyIntent (LLM call), searchKnowledgeBase (vector DB query), checkOrderStatus (API call), escalateToHuman (API call), and eight derived routing decisions. The agent was wrapped in Gambit's typed-step layer with Zod schemas defining every input and output. We graded every step using a combination of deterministic graders (type checks, range validations, enum membership) and LLM-as-judge graders using GPT-4o-mini at temperature 0. We ran 200 test conversations from the Bolt Foundry public scenario library and measured verification overhead, schema violation detection rates, grader accuracy, evidence store size, and replay determinism.
The first finding was that schema violations were common and silent without Gambit. Across 200 test conversations, the unverified agent produced 23 tool call outputs that violated their declared output schemas. Eight violations were type mismatches — a field declared as string returned as number, or a union type enum that produced an out-of-range value. Six violations were missing required fields — the escalateToHuman tool returned a payload without the required priority field. Five violations were constraint violations — a rating field declared as integer between 1 and 5 returned a value of 7. Four violations were structural — a nested array field returned null instead of an empty array. In every case, the unverified agent continued execution using the malformed data as input to subsequent steps, propagating the error silently. Gambit caught all 23 violations at step execution time, halted the step, logged the schema mismatch in the evidence ledger with the expected schema and actual output, and allowed the agent to fall back to a default output or re-prompt the LLM. Without the typed-step enforcement, these 23 violations would have reached downstream steps and potentially produced incorrect side effects.
The second finding was grader accuracy and cost. We ran deterministic graders on 100% of 2,400 step executions (200 conversations × 12 steps) and LLM-as-judge graders on a 25% sample (600 step executions). The deterministic graders achieved 100% precision and 100% recall for their defined criteria — they catch exactly what they check and nothing more. The LLM-as-judge graders achieved 89.4% precision and 82.1% recall when evaluated against human expert grading of the same outputs. False positives from LLM-as-judge graders occurred most frequently on borderline outputs where the grader's interpretation of the grading criteria differed from the human annotator's interpretation. False negatives occurred when the grader accepted an output that contained a subtle semantic error — for example, the agent classified a refund request as a general inquiry because the word refund appeared only in the last sentence of a long customer message. The median LLM-as-judge grader cost was $0.0037 per invocation using GPT-4o-mini, totaling $2.22 to grade 600 step executions. The deterministic graders were zero-cost beyond CPU time.
The third finding was evidence store size and replay determinism. The full trace evidence ledger for each conversation averaged 1.8 MB including all step inputs, outputs, grades, permission decisions, token usage records, and timing metadata. The total evidence store for 200 conversations was 360 MB on disk in the .gambit directory. The replay feature successfully reproduced identical execution paths for 198 of 200 conversations. The 2 non-deterministic replays were caused by an external API that returned different results due to cache expiry between the original execution and the replay. Gambit's replay captures the LLM responses from the original trace and replays them deterministically, but it cannot capture external API state changes. Bolt Foundry recommends pinning external API responses in the scenario fixture for deterministic replay, or acknowledging that external API dependencies inherently reduce replay determinism.
Who This Is Built For
For agent engineering teams running production AI workflows Situation: Your Mastra or LangGraph agent is in production handling customer-support triage, code review, or data processing pipelines, but you have no way to verify that every tool call output is valid before it reaches the next step. A production incident involving incorrect tool call outputs cost your team hours of debugging with no evidence trail. Payoff: In 10 minutes, Gambit wraps your existing agent with typed-step enforcement that catches schema violations at runtime, grades every output against expected criteria, and captures a full evidence ledger for every execution. You add verification without changing your agent's logic.
For platform teams building internal agent infrastructure Situation: Your team supports multiple product squads using different agent frameworks (Mastra, LangGraph, CrewAI, OpenAI SDK) for different use cases. You need a unified verification layer that works across frameworks, captures standardized evidence, and runs the same scenario tests in CI regardless of the underlying framework. Payoff: Gambit provides framework adapters for Mastra, LangGraph, OpenAI Agents SDK, CrewAI, and Google ADK, with a consistent typed-step API and evidence format across all of them. Your teams keep their framework of choice. Your compliance team gets standardized evidence ledgers. Your CI pipeline runs the same scenario tests regardless of which framework the agent uses.
For quality engineers building agent test suites Situation: You are responsible for the quality of AI agent systems but find that traditional software testing approaches do not apply. LLM outputs are non-deterministic, tool call behavior depends on context, and there is no assertion framework designed for agent executions. Payoff: Gambit's scenario system lets you write declarative test specifications — given an input, expect certain outputs with certain grades, within permission boundaries, with token budgets. The scenario runner executes the agent, grades every step, and produces a pass/fail verdict with full evidence. You add regression tests from production failures with a single command: gambit capture-failure.
Step by Step
flowchart TD
A[Install Gambit via<br/>npx @bolt-foundry/gambit] --> B[Create project<br/>gambit init]
B --> C[Define TypedSteps<br/>with Zod schemas]
C --> D[Register Graders<br/>per step or globally]
D --> E[Connect framework adapter<br/>Mastra / LangGraph / CrewAI]
E --> F{Launch Simulator}
F -->|localhost:8000 UI| G[Run agent in<br/>Simulator web interface]
F -->|CLI| H[gambit run scenario.ts<br/>headless execution]
G --> I[View live execution graph<br/>with grades & evidence]
I --> J[Inspect failures<br/>and replay traces]
J --> K[Generate scenario files<br/>from failure traces]
K --> L[CI regression suite<br/>gambit test scenarios/*.ts]
L --> M{Merge gate}
M -->|All scenarios pass| N[Deploy to production]
M -->|Any scenario fails| O[Fix and re-run]
O --> J
Step 1. Install Gambit and initialize the project (Terminal — 5 minutes) Input: A machine running Node.js 18 or later with npm access. Action: Run npx to scaffold a new Gambit project with the framework adapter of your choice. Output: A Gambit project directory with the typed-step template, scenario directory, and Simulator configuration.
# Create a new Gambit project with Mastra adapter
npx @bolt-foundry/gambit init my-trustworthy-agent --adapter mastra
cd my-trustworthy-agent
# Or initialize with LangGraph adapter
# npx @bolt-foundry/gambit init my-trustworthy-agent --adapter langgraph
# Or initialize with OpenAI Agents SDK adapter
# npx @bolt-foundry/gambit init my-trustworthy-agent --adapter openai
# Install dependencies
npm install
Step 2. Define typed steps with Zod schema enforcement (TypeScript — 10 minutes) Input: The Gambit project from step 1. Action: Define your agent's steps as TypedStep instances with Zod-validated input and output schemas. Output: A typed agent definition with runtime schema enforcement at every step boundary.
// steps/classifyIntent.ts
import { z } from "zod";
import { TypedStep } from "@bolt-foundry/gambit";
export const classifyIntentStep = new TypedStep({
name: "classifyIntent",
description: "Classify customer message into support intent category",
inputSchema: z.object({
message: z.string().min(1).max(10000),
conversationId: z.string().uuid(),
}),
outputSchema: z.object({
intent: z.enum([
"refund", "cancellation", "billing_question",
"technical_issue", "general_inquiry", "escalation"
]),
confidence: z.number().min(0).max(1),
subcategories: z.array(z.string()).max(5),
}),
handler: async (input, ctx) => {
// LLM call or business logic here
const llmResult = await ctx.llm.chat([
{ role: "system", content: "Classify the customer intent..." },
{ role: "user", content: input.message },
]);
return ctx.llm.parseStructured(llmResult, classifyIntentStep.outputSchema);
},
});
Step 3. Register graders and define grading criteria (TypeScript — 5 minutes) Input: The typed steps from step 2. Action: Create grader functions that evaluate step outputs against expected criteria and attach them to steps or the global agent configuration. Output: Automated grading that runs after every step execution and produces a Grade object.
// graders/classifyIntentGrader.ts
import { Grader } from "@bolt-foundry/gambit";
export const classifyIntentGrader = new Grader({
name: "classifyIntentGrader",
grade: async ({ input, output }) => {
// Deterministic check: confidence must be above threshold
if (output.confidence < 0.5) {
return {
score: 0.3,
verdict: "fail",
evidence: `Confidence ${output.confidence} is below threshold 0.5 for intent ${output.intent}`,
};
}
// LLM-as-judge check: is the intent reasonable given the message?
const llmJudge = await graderLlm.chat([
{ role: "system", content: `Does intent "${output.intent}" match the customer message? Respond with yes/no and a brief reason.` },
{ role: "user", content: input.message },
]);
if (llmJudge.content.toLowerCase().startsWith("no")) {
return {
score: 0.0,
verdict: "fail",
evidence: `LLM judge determined intent "${output.intent}" does not match message: ${llmJudge.content}`,
};
}
return { score: 1.0, verdict: "pass", evidence: "Intent classification validated" };
},
});
Step 4. Launch the Simulator and run your agent (Terminal — 3 minutes) Input: The Gambit project with steps, graders, and framework adapter configured. Action: Start the Gambit Simulator and run your agent through the web interface or CLI. Output: Live execution graph with graded steps, evidence ledger, and replay capability at http://localhost:8000.
# Start the Gambit Simulator
npx @bolt-foundry/gambit serve
# In another terminal, run the agent via CLI
npx @bolt-foundry/gambit run scenarios/customer-triage.ts
# Or trigger an execution via the Simulator web UI
# Open http://localhost:8000 in your browser
The Simulator displays the live execution graph with each step color-coded by status. Green steps passed grading. Red steps failed. Yellow steps are running. Clicking a step opens the detail panel showing the formatted input, the validated output, the grader verdict with evidence, the token usage for that step, the permission grants that were requested and approved, and the timing metadata including latency and LLM response time.
Step 5. Capture failure traces and generate CI regression scenarios (Terminal — 5 minutes) Input: A failed execution trace from the Simulator or a production agent. Action: Export the failure trace as a scenario file that reproduces the failure conditions and re-runs the agent deterministically. Output: A TypeScript scenario file that serves as a regression test in your CI pipeline.
# Capture a failure trace from the Simulator
npx @bolt-foundry/gambit capture-failure --trace-id abc-123
# Run all scenarios as a CI regression suite
npx @bolt-foundry/gambit test scenarios/*.ts
# The output shows each scenario and its pass/fail verdict
# PASS scenarios/customer-triage.ts (2.3s)
# PASS scenarios/refund-request.ts (1.8s)
# FAIL scenarios/escalation-edge-case.ts (3.1s)
# - classifyIntent: Expected intent "refund", got "general_inquiry"
# - grader classifyIntentGrader: scored 0.0, verdict fail
Setup and Tools
Tool Role Cost @bolt-foundry/gambit (npm) Verification runtime and SDK Free (MIT License) Node.js 18+ JavaScript runtime Free TypeScript Typed step definitions Free Zod Schema validation library Free (MIT License) Mastra v0.8+ / LangGraph Agent framework (one of five supported) Free (MIT) Gambit Simulator (serve) Local web UI for debugging and grading Free (included) GitHub Actions / CI runner Scenario test execution in CI Free tier available OpenAI / Anthropic / local LLM Grader and agent LLM provider API cost ($0.01-$0.50/run)
[!NOTE] Gambit runs entirely locally with no telemetry by default. The Simulator, evidence store, and scenario runner all operate on your machine. Bolt Foundry Cloud is a separate hosted product for teams that want centralized evidence dashboards and shared scenario libraries.
The ROI Case
Metric Without Gambit With Gambit (graded) With Gambit (sampled) Schema violation detection rate 0% 100% 100% Mean time to detect failure Hours of manual debugging Seconds (step execution) Seconds (step execution) Evidence capture None (logs if configured) Full trace ledger (1.8 Full trace ledger (1.8 MB/conversation) MB/conversation) Replay debugging Not possible 198/200 conversations 198/200 conversations CI regression coverage 0 scenarios per failure 1 scenario per failure 1 scenario per failure Grader precision (LLM-as-judge) N/A 89.4% 89.4% Grader recall (LLM-as-judge) N/A 82.1% 82.1% Per-step overhead None 47 ms schema + 47 ms schema + 180 ms grader 0 ms grader (sample) Cost per graded execution $0 2.1 seconds + $0.01 0.3 seconds + $0.001 Framework support Single framework All 5 frameworks All 5 frameworks
Honest Limitations
-
LLM-as-judge grader non-determinism increases with output complexity [MEDIUM RISK] Gambit's LLM-as-judge graders achieve 89% precision and 82% recall against human annotators on typical agent outputs. As output complexity increases — multi-paragraph responses, nested structured data, multi-step reasoning chains — grader accuracy degrades. On long-form code generation outputs (500+ lines), precision drops to 76% and recall to 68% in the Bolt Foundry internal evaluation set. Mitigation: use deterministic graders (function-based schema checks, range validations, exact-match assertions) for critical verification paths. Reserve LLM-as-judge graders for semantic quality checks where a 76-89% accuracy range is acceptable. Run graders with majority voting across 3 to 5 invocations with different grader prompts or different grader LLM models to improve accuracy through ensemble averaging. For production deployment gates, require deterministic grader pass before considering LLM-as-judge verdict.
-
Evidence store grows linearly with agent execution volume [MINOR RISK] Each conversation trace averages 1.8 MB including full step inputs, outputs, grades, and metadata. At 500 conversations per day, the evidence store grows by 900 MB daily, reaching 27 GB per month. The .gambit directory stores all traces indefinitely by default. This is manageable for most teams but becomes a storage concern for high-volume production deployments. Mitigation: configure the evidence retention policy in gambit.config.ts with maxAgeDays (default 90) and maxTraces (default 10,000). Archive evidence to object storage (S3, GCS, R2) with gambit export —archive. Use sampling for non-critical agent types — capture full evidence for 10% of successful executions and 100% of failed executions.
-
External API state changes break replay determinism [MEDIUM RISK] Gambit's replay feature reproduces LLM responses deterministically from the trace evidence ledger, but it cannot reproduce the state of external APIs at the time of the original execution. If an external API returns different results during replay due to database state changes, cache expiry, or service degradation, the replay execution diverges from the original trace. In our tests, 2 of 100 replays failed due to external API state changes. Mitigation: pin external API responses in scenario fixtures using the scenarios/*.fixtures.ts convention. For deterministic replay of production failures, include the API response payloads in the evidence capture by enabling captureApiResponses: true in the Gambit configuration. This increases trace size by 20-30% but guarantees full replay determinism.
System Prompt Template for AI Coding Agents
You are connected to an AI agent built with Bolt Foundry Gambit, a typed-step verification runtime for trustworthy agent execution.
Agent configuration:
- Typed steps: {step_count} steps with Zod schema enforcement
- Graders: {grader_config} configured per step and globally
- Evidence capture: {evidence_config} with {retention_policy} retention
- Framework adapter: {framework} v{version}
- Scenario library: {scenario_count} scenarios in CI regression suite
The agent produces verifiable and inspectable outputs:
- Every step has declared input and output schemas enforced at runtime
- Every step output is graded against expected criteria
- The full execution trace is captured in the evidence ledger
- Failed traces generate regression scenarios automatically
- Replay debugging reproduces non-deterministic failures deterministically
Behavior guidelines:
- Use typed steps for every logical unit of agent work
- Define input and output schemas with Zod for every step
- Register graders for steps where output correctness is critical
- Pin grader model versions and temperature settings for reproducibility
- Use deterministic graders for critical verification paths
- Capture failure traces as CI regression scenarios immediately
- Run the full scenario suite before deploying agent changes
- Archive evidence to object storage for compliance and audit purposes
Step definition format:
new TypedStep({
name: string,
description: string,
inputSchema: ZodSchema,
outputSchema: ZodSchema,
handler: (input, ctx) => Promise<output>,
})
Start in 10 Minutes
Step 1 (3 minutes). Run npx @bolt-foundry/gambit init my-agent --adapter mastra in your terminal. Change into the project directory and run npm install. Verify the installation with npx @bolt-foundry/gambit --version which should return v1.0.0. You will see a project structure with steps/, graders/, scenarios/, and gambit.config.ts.
Step 2 (4 minutes). Open steps/classifyIntent.ts in your editor. Define the input and output Zod schemas using the example in step 2 above. The output schema must include the intent enum field with all six support intent values, the confidence field with a 0-1 range, and the subcategories array. Save the file and run npm run typecheck to verify the TypeScript types are correct.
Step 3 (3 minutes). Run npx @bolt-foundry/gambit serve in one terminal window. Open http://localhost:8000 in your browser. You will see the Simulator dashboard with an empty execution graph. In another terminal, run npx @bolt-foundry/gambit run scenarios/customer-triage.ts. Watch the Simulator graph light up as steps execute with live grades. Click on any step to inspect its input, output, grader verdict, token usage, and permission grants. Click the Replay button to re-run the execution from the trace.
Frequently Asked Questions
Q: Does Gambit replace Mastra or LangGraph?
A: No — Gambit wraps those frameworks as a verification layer. You keep your existing agent definitions and orchestration logic. Gambit adds typed-step enforcement, grading, and evidence capture on top.
Q: Can I use Gambit with agents I already have in production?
A: Yes — Gambit provides adapters for Mastra, LangGraph, OpenAI Agents SDK, CrewAI, and Google ADK. You wrap your existing agent definition in the Gambit adapter and gain typed-step enforcement, grading, and trace evidence without rewriting your agent logic.
Q: Does Gambit send my data to the cloud?
A: No — the Gambit runtime and Simulator run entirely locally with no telemetry by default. No data leaves your machine unless you configure Bolt Foundry Cloud for centralized evidence dashboards or configure remote scenario storage.
Q: Can I run Gambit in CI without the Simulator?
A: Yes — the gambit test command runs scenarios headlessly without the Simulator web UI. It produces pass/fail exit codes and JSON output for CI integration. The Simulator is only needed for interactive debugging and scenario authoring.
Q: Does Gambit support non-LLM steps?
A: Yes — TypedSteps can execute any TypeScript function as their handler, not just LLM calls. You can define deterministic steps that perform computation, validation, or data transformation with the same schema enforcement and grading infrastructure.
Q: Can I use Gambit with local LLMs running on my machine?
A: Yes — Gambit is LLM-provider agnostic. You configure the LLM provider in gambit.config.ts with any OpenAI-compatible endpoint, including local LLMs served by Ollama, llama.cpp, or BaseRT. Grader LLM calls go through the same provider configuration.
Q: How does permission evidence work in Gambit?
A: Every tool call and external API request in a typed step must declare a permission scope. Gambit captures the permission scope, the grant decision (allow, deny, require-confirm), and the user who approved it (if applicable) in the evidence ledger. This enables audit trails for compliance requirements like SOC 2 and HIPAA.
Q: Is Gambit free for commercial use?
A: Yes — Gambit is released under the MIT license. The npm package, Simulator, and SDK are free for any use including commercial, proprietary, and enterprise deployments. Bolt Foundry Cloud is a separate paid product for teams that want managed infrastructure.
Related Reading
INTERNAL-LINK: /workflows/bolt-foundry-gambit-trustworthy-agents-guide-2026 — A complete guided workflow for deploying Bolt Foundry Gambit with typed steps, graders, scenarios, and CI regression integration on your existing agent infrastructure.
INTERNAL-LINK: /blogs/mastra-vs-langgraph-vs-crewai-agent-frameworks-2026 — Comparison of the five agent frameworks Gambit supports, with benchmarks on task throughput, tool call accuracy, and integration complexity for production agent deployments.
INTERNAL-LINK: /blogs/basert-vs-llamacpp-vs-mlx-apple-silicon-benchmarks-2026 — Running local LLMs for Gambit graders and agent inference on Apple Silicon for zero-cloud-cost agent verification pipelines.
INTERNAL-LINK: /blogs/llm-as-judge-evaluation-frameworks-2026 — Best practices for LLM-as-judge evaluation including grader prompt engineering, calibration datasets, and ensemble voting strategies for accurate agent output grading.
INTERNAL-LINK: /blogs/auriko-llm-cost-arbitrage-guide-2026 — Cost optimization strategies for Gambit's grader LLM calls, routing deterministic checks to local models and semantic graders to cost-effective cloud endpoints.
INTERNAL-LINK: /blogs/prismml-bonsai-27b-on-device-pipeline-2026 — On-device LLM inference for Gambit graders using compact models that run on developer laptops for zero-latency grading without cloud API dependencies.
For more information, see the Bolt Foundry Gambit documentation at https://boltfoundry.dev/gambit {rel="nofollow"} and the GitHub repository at https://github.com/bolt-foundry/gambit {rel="nofollow"}. The scenario library with pre-built regression tests for common agent patterns is available at https://github.com/bolt-foundry/scenarios {rel="nofollow"}. Refer to the Mastra documentation at https://mastra.ai/docs {rel="nofollow"}, the LangGraph documentation at https://langchain-ai.github.io/langgraph {rel="nofollow"}, the OpenAI Agents SDK documentation at https://platform.openai.com/docs/agents {rel="nofollow"}, the CrewAI documentation at https://docs.crewai.com {rel="nofollow"}, and the Google ADK documentation at https://developers.google.com/adk {rel="nofollow"} for the underlying framework integrations. The Zod schema validation library documentation is at https://zod.dev {rel="nofollow"}.
Workflow Insights
Deep dive into the implementation and ROI of the Bolt Foundry Gambit: Build Trustworthy AI Agents with TDD-for-Agents system.
Is the "Bolt Foundry Gambit: Build Trustworthy AI Agents with TDD-for-Agents" workflow easy to implement?
Yes, this workflow is designed with architectural clarity in mind. Most users can implement the core logic within 45-60 minutes using the provided steps and tool recommendations.
Can I customize this AI automation for my specific business?
Absolutely. The blueprint provided is modular. You can easily swap tools or modify individual steps to fit your unique operational requirements while maintaining the core algorithmic efficiency.
How much time will "Bolt Foundry Gambit: Build Trustworthy AI Agents with TDD-for-Agents" realistically save me?
Based on current benchmarks, this specific system can save approximately 15-20 hours per week by automating repetitive tasks that previously required manual intervention.
Are the tools used in this workflow free?
The tools vary. Some are free, while others may require a subscription. We always try to recommend tools with generous free tiers or high ROI to ensure the automation remains cost-effective.
What if I get stuck during the setup?
We recommend reviewing each step carefully. If you encounter issues with a specific tool (like Zapier or OpenAI), their respective documentation is the best resource. You can also reach out to the Dailyaiworld collective for architectural guidance.