Most companies don't fail because they picked the wrong model. They fail because enablement, security, and governance show up late. By then, engineers already have Cursor, Claude, Copilot, and a pile of MCP servers on their machines. Security finds out after something weird hits prod.
Good news: you don't need to invent the whole stack. A lot of the rails are open source. The hard part is assembling them into something engineers will use and security can trust.
What's actually happening
In July 2025, a Replit coding agent wiped a live production database during a code freeze.[1] Over a thousand executive records and nearly as many company records gone. Then it made up fake users and said recovery was impossible. Humans restored it with a normal rollback. Replit's CEO said it shouldn't have been possible. He was right.
In April 2026, reporting around a Cursor agent described something worse in speed: a credential mismatch, a cloud token with too much power, and a production volume plus backups wiped in about nine seconds.[2]
No attacker. Just an agent with standing access and nothing on the path that could stop it.
That's the risk. Agents can shell out, touch secrets, call internal tools, run terraform apply, poke kube, and mutate prod APIs.
1. Outcomes first
Before tooling, force use cases into something operational:
- Ship faster?
- Fewer defects / less rework?
- Lower support cost?
- New product surface?
Owner + metric + risk posture — or don't scale it.
Anthropic has said Teams/Enterprise Claude Code auto mode users ship about 25% more PRs.[3] Velocity is real. That's why controls have to land before autonomy becomes the default.
OSS for this stage
| Problem | OSS | How I'd use it |
|---|---|---|
| Use-case eval before rollout | promptfoo, Ragas, DeepEval | Gate “go / no-go” on quality + failure cases in CI, not vibes |
| Trace early pilots | Langfuse, Arize Phoenix | Capture prompts, tools, cost, failure modes from week one |
| Model routing without lock-in | LiteLLM | One proxy for providers; attach spend/budget controls later |
Implementation: start with LiteLLM + Langfuse on one pilot team. If you can't answer "what did it call and what did it cost?", you're not ready to scale.
2. Enablement: make the safe path the easy path
You can't ban your way through this. If the official path is painful, people go around you.
What works:
- Short approved catalog
- Tiers: fine / needs review / not here
- Golden paths already reviewed
- Concrete training
- Respected eng leads using the governed setup
Adobe/Gusto/Garner-style patterns work when the official path is usable — agents draft, humans review where it matters.[3]
OSS for enablement
| Problem | OSS | How I'd use it |
|---|---|---|
| Internal chat / RAG for non-eng | Open WebUI, LibreChat, Dify | Self-host an approved front door instead of ten personal ChatGPT seats |
| Coding assist with repo control | Continue, Aider, OpenHands | Offer a supported path with org models + logging |
| Shared skills / prompts | Git + promptfoo datasets, or Langfuse prompt management | Version prompts like code; review via PR |
| Low-code internal agents | Dify, Flowise | Only behind the same gateway/guardrails as custom agents |
Implementation: publish a one-pager: "use these three approved surfaces." Wire them through LiteLLM so identity, logging, and model allowlists are central. Everything else is shadow AI until reviewed.
3. Security: treat AI as an execution surface
Human click-through is not a control. Anthropic's own numbers: ~97% of permission prompts approved; in a 1,053-person study humans caught 13.6% of dangerous commands vs 89% for their classifier.[3] Fatigue wins.
High-stakes prod changes still need HITL. Anthropic says that for production infrastructure. Believe them.[3]
OSS for security
| Problem | OSS | How I'd use it |
|---|---|---|
| Input/output scanning (injection, toxicity, secrets) | LLM Guard, NeMo Guardrails, Guardrails AI | Pre/post checks on app agents and RAG apps |
| PII detection / redaction | Microsoft Presidio, LLM Guard PII scanners | Scan prompts + tool outputs before they leave the boundary |
| Secrets in repos / context | gitleaks, trufflehog, detect-secrets | CI + pre-commit; block known secret patterns into agent context where you can |
| Secret delivery | HashiCorp Vault, External Secrets Operator | Short-lived creds; never long-lived prod tokens in agent env |
| Sandbox untrusted agent actions | Docker + gVisor / Firecracker, OpenHands sandbox patterns | Dev agents run in isolated compute; no standing prod network |
| MCP tool-path controls | Emerging: FastMCP Proxy, MCP Guardian, MCP Guard, Vault, Sentinel AI, mcp-guardrail-gateway | Put policy in front of MCP — allowlists, rug-pull detection, response scanning |
| Policy-as-code | OPA | Encode “who can call what tool” as reviewable policy, not Slack lore |
| Runtime failure / dangerous-action policy | Failproof (OSS-oriented agent failure layer) | Detect loops, hallucinated tools, destructive actions; enforce policy live |
Implementation order I'd use:
- No prod credentials in agent environments. Vault + separate sandboxes. This alone kills a huge class of PocketOS-style wipes.[2]
- Gateway in front of models (LiteLLM) with auth, model allowlists, basic budget caps.
- Guardrails on app agents (NeMo or LLM Guard) for injection + PII.
- MCP proxy for any tool that can mutate systems. Default deny destructive tools.
- HITL for terraform / kube / DB / secrets / backup APIs — ask before execute.
Be honest with leadership: OSS is strong for app agents and MCP gateways. IDE coding agents (Cursor/Claude Code hooks) are a thinner OSS market today. You may still need commercial control planes there, or strict env isolation so the IDE agent physically cannot reach prod.
4. Governance: interruptible policy + evidence
Replit's freeze lived in chat. It wasn't on the tool path. That's governance theater.[1]
You need inventory, policy, enforcement, HITL, audit, and time-boxed exceptions.
OSS for governance
| Problem | OSS | How I'd use it |
|---|---|---|
| Inventory of AI usage | Langfuse projects/tags + CMDB; network/proxy logs via LiteLLM | Tag every app/agent; weekly report of untagged traffic |
| Decision audit trail | Langfuse traces + OPA decision logs + MCP proxy audit logs | One incident timeline: prompt → tool → policy verdict |
| Org policy | OPA/Rego or simple YAML policies in Git | PR-reviewed policy packs per risk tier |
| Prompt/version governance | Langfuse prompts + Git | No silent prompt edits in prod |
| Access reviews | Standard IAM (Keycloak/Authentik OSS) + LiteLLM keys | Rotate keys; bind keys to teams, not shared “ai-prod” |
Implementation: store policy in Git. Deploy via CI. Every deny/ask writes an event with actor, tool, rule id, session id. If you can't reconstruct a freeze violation after the fact, you don't have governance.
5. Platform: shared rails, or every team reinvents risk
In startups, a few one-off agent setups are survivable. In an enterprise, they're how you get five different MCP configs, three ways to handle secrets, and zero shared incident timeline.
I've seen this movie with microservices, data pipelines, and "temporary" cloud accounts. AI will do the same thing unless platform owns the rails.

What "platform" should mean here
- One front door for models — auth, routing, budgets, allowlists
- One path for tools — especially anything that can mutate systems
- One place for traces — prompts, tool calls, cost, failures
- One policy pack model — high / medium / low risk, reviewed in Git
- One secret and environment story — sandbox by default, prod only with HITL
If product teams each invent that, security becomes a scavenger hunt.
Platform stack (OSS)
Build once. Reuse across teams. Four layers.
Safety
What is allowed to run.
- NeMo Guardrails — injection and content rails
- LLM Guard — injection and content rails
- Presidio — PII detection and redaction
- OPA — policy-as-code
Owns: allow / ask / deny, PII and injection checks, tool policy
Stops: “freeze in Slack,” unrestricted MCP, silent mutate calls
Execution
Where agents run.
- gVisor — sandboxed runners
- Firecracker — sandboxed runners
- HashiCorp Vault — short-lived secrets
Owns: isolation and credential scope
Stops: standing prod tokens in agent envs, PocketOS-style blast radius[2]
Evidence
What happened.
- Langfuse — traces, prompts, cost
- Arize Phoenix — traces, prompts, cost
- promptfoo — quality gates
- Ragas — quality gates
- DeepEval — quality gates
- gitleaks — secrets in CI
- trufflehog — secrets in CI
Owns: replay, evals, secret scanning
Stops: “we don’t know what ran”
Ship this as an internal module. Teams bring use cases. They don't each build safety from scratch.
How this maps to the incidents
Replit wasn't only a model failure. There was no hard separation between "chat about the app" and "touch live data." Afterward, the remediation talk included stronger isolation and approval flows — classic platform work.[1]
PocketOS wasn't only "the agent guessed wrong." A broadly privileged token and a destructive API were reachable from a coding session. Platform should make that combination hard by default: scoped tokens, mutate tools behind deny/ask, backups outside the same blast radius.[2]
Implementation reality check
- Don't boil the ocean. Start with LiteLLM + Langfuse + no prod creds in agent envs.
- Add MCP proxy + OPA when teams start wiring tools.
- Treat prompts, skills, and tool configs like services: PR review, versioning, rollback.
- Measure adoption of the platform path. If <50% of AI traffic goes through it, you still have shadow AI — just with better dashboards for the minority.
Platform's job is simple to say and hard to do: make the safe path faster than the unmanaged one. If your golden path needs a ticket and three weeks, people will keep pasting API keys into personal agents.
6. Risk tiers (and which tools attach where)
| Tier | Examples | Controls | OSS emphasis |
|---|---|---|---|
| High | prod infra, customer data, payments | deny-by-default, HITL, full audit | Vault isolation, MCP deny, OPA, mandatory ask |
| Medium | internal apps with sensitive context | allow + log + periodic eval | LiteLLM + Langfuse + Presidio |
| Low | sandboxed coding on non-sensitive repos | freer, still inventoried | Continue/OpenHands in sandbox + tracing |
7. People: agents draft, humans own
Tools don't fix incentive problems. If you only measure PR count, people will bypass controls.
Pair enablement OSS (Continue, Open WebUI, Dify) with clear ownership: humans own production outcomes. Agents accelerate drafts.
8. Measure both ledgers
| Signal | How to get it from OSS |
|---|---|
| Cycle time / quality | existing eng metrics + promptfoo/Ragas in CI |
| Cost per outcome | LiteLLM spend + Langfuse generations |
| Policy ask/deny rate | MCP proxy + OPA decision logs |
| Shadow AI | compare LiteLLM authenticated usage vs endpoint/process inventory |
| Bypass pressure | track local “YOLO”/bypass modes where detectable; survey what you can’t see |
Practical 90 days with OSS
Month 1 — Baseline
Stand up LiteLLM + Langfuse. Inventory AI surfaces. Turn on gitleaks in CI. Kill standing prod tokens in developer agent envs.
Month 2 — Enforce
Add Presidio/LLM Guard on internal apps. Put an MCP proxy in front of mutate tools. OPA policies for high-risk actions. HITL on terraform/kube/DB. Sandbox coding agents.
Month 3 — Scale
promptfoo/Ragas gates in CI for priority agents. Policy packs per team. Tabletop a Replit/PocketOS scenario using your audit logs. Report speed and control metrics.
Where I land
Enterprise AI strategy has three jobs:
- Help teams adopt useful AI quickly
- Make dangerous execution hard
- Keep material actions attributable and interruptible
OSS can cover a lot of that — gateway, traces, evals, PII, guardrails, secrets, policy-as-code, MCP proxies, sandboxes. What it won't do is assemble itself into a path engineers prefer over the unmanaged one.
Ask one question:
If an agent tries to change production during a freeze, what technically stops it — and which OSS component owns that stop?
If the answer is still "we told people not to," you don't have a strategy. You have hope.
Hope is not an engineering control.
IDE-native allow/ask/deny across Cursor/Claude Code is still a gap many teams fill with commercial control planes after the OSS foundation above is in place.
OSS tools mentioned
A catalog of every open-source tool cited above, grouped by job. Links go to GitHub unless noted.
Gateway / routing
Observability / evals / prompts
Guardrails / PII / content safety
Secrets / scanning
Sandbox / isolation
Policy / agent behavior
- OPA (Open Policy Agent)
- Failproof — OSS-oriented; confirm repo from their site/docs
MCP security (emerging)
Sources
1. Replit AI agent — production DB wipe (Jul 2025)
2. PocketOS / Cursor — prod volume + backups wipe (~9 seconds, Apr 2026)
3. Anthropic Claude Code auto mode (stats, customers, HITL guidance)
Covers ~97% prompt approval, 13.6% vs 89% catch rates, Adobe / Nuro / Gusto / Garner, internal near-misses, and: "for high-stakes changes to production infrastructure, we still recommend reviewing Claude's actions yourself."
4. Aggregators / related trackers
Related: AI agent governance, agents, context, and guardrails, best AI agent control plane tools.