Image
Build
Connect & operate
Design & teams
Start hereScope a build in one callBring a spec, a wireframe, or a paragraph. You leave with an architecture, a timeline, and a number.Request a scoping call
AI software
LLM & data systems
Vibe coding
Ready to ship?Put AI where the work isAgents, RAG, and private LLMs wired into the systems your team already uses — not a chatbot bolted to a homepage.Discuss an AI project
Domain firstWe learn your workflow before we model itRegulated, operational, or high-volume — the constraints belong in the schema, not in a training doc.Talk about your domain
Samuel Edwards
Author
Retrofitting Your SaaS With AI Agents Without a Rewrite — featured image
11/23/2026

Retrofitting Your SaaS With AI Agents Without a Rewrite

Gartner projects more than 40% of agentic AI projects will be canceled by the end of 2027, with cost overruns and inadequate risk controls high on the failure list. For a SaaS with paying tenants, a schema, and an RBAC model, that number says the model is not the hard part of a retrofit.

The goal is not a new product. It is agent features that plug into the schema you already have, inherit the permissions you already enforce, and roll out without destabilizing customers you already bill.

The constraints are the event bus, the tenancy model, and the flag system. Where those three are solid, a retrofit ships in months. Where any one is weak, the retrofit exposes it first.

Start at the Event Bus, Not the UI

The temptation with a retrofit is to bolt an agent onto a page: a sidebar, a chat panel, a button labeled "ask." The useful work lives behind the event bus. Significant tenant events — invoice created, ticket escalated, deal stage moved — already publish to a topic that existing handlers subscribe to. Agents belong on those topics, reading context from the same stream and publishing proposed actions back as new events your current handlers accept.

Anthropic's 2026 agent report found that 46% of organizations cite system integration as the top barrier to agent deployment, with 57% already running multi-stage workflows. The integration pain shrinks when agents consume and emit the same schema the rest of the services pass around. No new RPC surface, no parallel orchestration layer, no bespoke queue. A planner subscribes, a tool worker subscribes, a reviewer subscribes. Each one is a service in a shape the platform already knows how to deploy, with the same blast-radius controls as anything else on the bus.

Rollback stays cheap. Shut off the subscription and the surface disappears without touching the write path.

MCP Integrations That Opened the Agent Tool Surface
MCP Integrations That Opened the Agent Tool SurfaceAnthropic SDK release: 0; OpenAI Agents SDK adoption: 4; Google DeepMind (Gemini) support: 5; MCP Registry launch: 10; AWS Bedrock AgentCore Gateway GA: 11; Linux Foundation governance (AAIF): 1306121824Anthropic SDK release0–24OpenAI Agents SDK ado…4–24Google DeepMind (Gemi…5–24MCP Registry launch10–24AWS Bedrock AgentCore…11–24Linux Foundation gove…13–24
Months counted from Anthropic's MCP release in November 2024; all milestones remain in effect. Source: Ginger Labs, 2026

Agents Inherit RBAC, They Do Not Invent It

Permissions are the retrofit's first real test. Agents must not become privileged robots that read across tenants because they are "AI." Every agent action should be a request on behalf of a specific user in a specific tenant, with that user's existing role, scope, and row-level policies. If the schema uses tenant_id and RLS in Postgres, the agent connects through the same pool, under the same JWT, with the same claims.

That means an agent runs as a principal, not a daemon. Give it a service user per tenant, or a delegated token minted by the same auth server your API uses. The same patterns that govern multi-tenant data isolation apply unchanged here: scope by claim, enforce in the database, log the principal on every action. An agent that cannot pass an existing audit does not belong in the retrofit.

SCIM provisioning deserves attention early. If the agent exists as a workspace principal, it needs the same lifecycle as a human user: created on tenant signup, scoped to its role, deprovisioned on offboarding. Skip that and agent identities outlive the humans who created them, which is how unauthorized agents end up in production.

An engineer's hand holds a labeled key ring where each key opens a specific door, illustrating scoped per-tenant access.

Scope the Blast Radius Per Tenant

Tenant isolation is only half the problem. The other half is throttling what one agent can do to one tenant before a human notices. The usual controls are per-tenant rate limits on tool calls, write caps per action class, and a kill switch keyed on the agent identity rather than the whole feature.

Most risk-control failures look the same in review: no circuit breaker, no quota, no audit trail scoped to tenant. Outbound actions should flow through an allowlisted tool layer, not direct database or integration calls. The same layer is where approval and audit controls live, so an action that mutates billing, exports data, or sends a customer email can route through a review path your existing admins already use.

Keep the cost controls at the same granularity. Token spend is a tenant-level budget, not a product-level one, and runaway loops happen one tenant at a time. Cap tokens, log every tool call with the tenant and principal, alert on anomalies against last week's baseline. None of this is exotic. It is the same shape as the per-tenant quotas you already enforce on API calls and exports.

What Enterprises Know (and Do Not) About Their AI Agents
What Enterprises Know (and Do Not) About Their AI AgentsFound unknown AI agents in past year: 82%; Experienced agent-related incidents: 65%; Have formal agent decommissioning: 21%YesNoFound unknown AIagents in past year82%18%Experiencedagent-related…65%35%Have formal agentdecommissioning21%79%
January 2026 survey of 418 IT and security professionals. Source: Cloud Security Alliance, 2026

Shadow Mode Comes Before Shipping

Before an agent action reaches a tenant's data, it should spend time in shadow mode: full context, full planning, full proposed action, but the final write is suppressed and compared against what a human or the existing system did. LangChain's 2025 practitioner survey found that 89% of teams have observability but only 52% run evaluations, which is the missing evaluation layer shadow mode supplies. Observability shows what the agent did. Evaluation tells you whether it was right.

Keep a shadow log per tenant with the proposed diff, the actual diff, the human verdict, and a replayable trace. When agreement rates hold and the tails have been inspected, promote the agent to assisted mode: it proposes, a human approves, the write executes. Only once assisted mode is calm does unattended write access ship, and even then only on actions with bounded downside — a refund under $50, a status change, a tag.

Shadow mode also produces the number a CFO can read. "We shadowed 12,000 invoice-matching proposals, 94% agreement, 73 disagreements reviewed, 61 agent-correct" is an argument. A demo is not.

A Strangler-Fig Rollout for Agent Features

The strangler-fig pattern applies cleanly to agent features. Pick one workflow, route a small percent of tenants to the agent path behind a feature flag, and route the rest through the existing handler. Measure, widen, retire the old path only when the new one is boring. The flag system is doing the real work, which is why a retrofit without flag infrastructure is a bad idea regardless of model quality.

Scope the flag to tenant cohorts, not global on-off. Internal tenants first, then design partners, then free-tier accounts, then the long tail. Each cohort can be rolled back independently, and a misbehaving agent never reaches a tenant that never opted in.

Gartner projects that 75% of API gateway vendors will integrate MCP features by end of 2026, which matters to teams planning to expose internal tools to agents through a standardized layer. Whatever the transport, keep the agent-facing tool surface small, versioned, and owned by the team that owns the underlying API. The AI engineering teams we embed see these retrofits land cleanly when flags, event schemas, and RBAC already exist, and stall when any one is missing.

The Spend Behind Every Retrofit Decision
The Spend Behind Every Retrofit Decision2024: $153B; 2025: $318B; 2026 (forecast): $497B$0B$248.5B$497B$153B2024$318B2025$497B2026 (forec…
Global AI infrastructure spending by year; 2026 is forecast. Source: IDC, 2026

Where Retrofits Actually Stall

Three situations, three next steps.

Where the platform already has a mature event bus, strong RBAC, and tenant-scoped flags, start a retrofit in shadow mode on one workflow with bounded blast radius, and give it eight to twelve weeks before promoting anything to assisted writes. Expect the hard part to be evaluation, not models.

Where one of those three is missing, fix that first. Retrofitting agents onto a system without row-level tenant enforcement, or without feature flags scoped to tenant cohorts, exports the agent's bugs directly to every customer. A short sandbox project ahead of the retrofit is usually cheaper than cleaning up after the first incident.

Where you cannot tell today whether agents are already calling your APIs, start with inventory. The 82% unknown-agent figure from the Cloud Security Alliance, plotted above, is the version of this retrofit nobody plans for and everybody eventually inherits. Catalogue what is already running under which service accounts before adding anything new.

Author
Samuel Edwards
Samuel Edwards is the Chief Marketing Officer at DEV.co, SEO.co, and Marketer.co, where he oversees all aspects of brand strategy, performance marketing, and cross-channel campaign execution. With 15+ years of experience in digital advertising, SEO, and conversion optimization, Samuel leads a data-driven team focused on generating measurable growth for clients across industries. Samuel has helped scale marketing programs for startups, eCommerce brands, and enterprise-level organizations, developing full-funnel strategies that integrate content, paid media, SEO, and automation. He is a frequent speaker and contributor on digital trends, with work featured in Entrepreneur, Inc., and MarketingProfs. Based in the greater Orlando area, Samuel brings an analytical, ROI-focused approach to marketing leadership.