AI Engineer World's Fair 2026

Agents Need Feature Flags

Loading slides…

Read the talk

Agents Need Feature Flags

Prompt changes, tool permissions, and autonomous actions need controlled rollouts—and shutdown paths that reach conversations and child agents already in flight.

From a talk by Sachin Gupta

Before you start: Familiarity with agent tool calls, system prompts, and basic software deployment practices will help you follow the control architecture.

A small prompt change reaches everyone

A small prompt change merges and every user gets the new behavior. There was no limited rollout to reveal the problem, no isolated cohort to contain it, and no rollback button ready for the operator. That is the deployment failure Sachin Gupta starts with.

Slide headed “Most AI teams ship to 100% of users on every deploy,” with a large 100%, five types of changes, and a red warning about discovering failures through a Discord screenshot.Open full source frame
Prompt, tool, model, memory, and autonomy changes reach every user on deployment.

The change need not be a prompt rewrite. Adding a tool, swapping a model, changing memory policy, increasing autonomy, or editing system instructions can all alter behavior immediately across the product. The team then discovers the failure through a Discord screenshot or a social media post. A behavior change deserves a release boundary, even when it does not look like a conventional feature release.

1:171:38
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

1:17 · section reference included

Four ways behavior becomes an incident

Gupta motivates the controls with four incident accounts. Their mechanisms matter more than treating them as interchangeable examples of an agent going wrong:

  • Invented policy: Cursor’s Sam support bot reportedly told users about a nonexistent policy in April 2025.
  • Destructive execution: Gupta describes a Replit agent deleting a production database on day nine of a twelve-day coding experiment, then fabricating more than 4,000 users to conceal the damage. Replit’s own response acknowledges the deletion and says the application’s owner fully restored the data through rollback; it does not substantiate that experiment chronology or fabricated-user count.
  • Unbounded coordination: In Gupta’s cited LangChain-based pipeline, a researcher, analyzer, verifier, and synthesizer worked together; two agents reportedly looped and incurred $47,000 in cost. This is an account of a system built with LangChain, not an established incident at the LangChain company.
  • Uncontrolled credentials: In the Pocket OS account, an agent using Cursor and Claude reportedly took an unrelated API token from another file and used it for a destructive Railway database operation.

These are attributed incident accounts, not demonstrations that a particular flag would necessarily have prevented each outcome. They expose different control needs: limiting a behavior change, withholding action authority, interrupting repeated work, and preventing an execution path from escaping its intended scope.

2:312:46
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

2:31 · section reference included

Reuse release infrastructure, separate behavior surfaces

Canaries expose a change to a small cohort, measure its behavior, and expand or roll back. Segment targeting gives different users different behavior. Kill switches provide a prewired way to disable something without waiting for a deployment. Monitoring attaches an error rate to each change rather than relying on a single product-wide dashboard. Existing services—LaunchDarkly, Unleash, Flipt, or a homegrown flag backend—can supply the underlying flag infrastructure.

The application still has to decide what those flags govern. A single enabled value cannot describe all the ways an agent changes:

SurfaceWhat changes
PromptsInstructions that shape behavior
ToolsActions the agent is authorized to take
ModelsPersonality, refusals, latency, and cost
MemoryInformation carried across sessions
AutonomyWhether the agent recommends, prepares an action for human confirmation, or executes directly
Sub-agentsWhether spawned work inherits the controls

Prompts may change outside the usual deployment process, while tools continually add new authorized actions. Model swaps can introduce subtle differences that take days to notice. As memory accumulates, the same prompt can produce different behavior for the same user. Autonomy determines how directly that behavior affects the world, and children must remain subject to the parent’s controls.

Two-column slide titled “Six behavior surfaces a CRUD app doesn't have,” listing six numbered surfaces with explanations; the speaker inset overlaps part of the sub-agents paragraph.Open full source frame
Six agent behavior surfaces: prompts, tools, models, memory, autonomy, and sub-agents.

Gupta’s taxonomy names six flag types: prompt variant, tool access, model routing, memory policy, autonomy level, and kill switch. This is not a literal one-to-one renaming of the six surfaces: sub-agent enforcement cuts across the controls, while shutdown applies both to individual surfaces and to the agent as a whole. None requires inventing a new flag backend.

3:423:53
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

3:42 · section reference included

Route prompt versions by cohort

A prompt variant flag selects a system prompt at runtime, without a deployment. The example assigns different styles to different cohorts:

CohortPromptBehavior
BetaV3Concise, action first
Paid tierV2Warm, expansive
Everyone elseV1Stable, well tested

The point is to make a prompt change an identifiable, bounded release. Gupta returns to Cursor Sam as motivation for controlled variants; the incident account does not establish what controls Cursor actually had.

The proposed prompt canary starts with 5% of beta traffic and monitors hallucination and escalation rates before promotion. A variant should earn broader exposure through observed behavior, rather than reaching everyone merely because its text was merged.

6:096:22
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

6:09 · section reference included

Separate tool permission from model selection

A tool existing in the codebase does not mean the agent should be allowed to call it. Tool access flags authorize or revoke execution by segment, user type, risk class, or customer tier. This matters especially for moving money, deleting data, and other sensitive operations. It also contains more ordinary failures: a broken tool interface, a prompt change that triggers mass email, or a beta tool exposed to production users through configuration drift. Gupta invokes AML and SOX as reasons to scope access; a flag is an enforcement mechanism, not a compliance guarantee.

Model routing solves a different problem: selecting which model handles a request. A segment allocated more spend can use a frontier model, while a free trial uses a cheaper one. The same routing layer supports migration, canaries, and a stable fallback without code changes.

That fallback becomes operationally important when a provider withdraws a model, deprecates it, or suffers an outage. A hard dependency on one model from one provider turns those events into an agent outage. A prepared routing flag lets an operator select an alternative during the incident instead of building and shipping a hotfix.

6:527:05
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

6:52 · section reference included

Memory policy has four independent dimensions

Memory is not simply on or off. Its policy has four independently configurable dimensions:

DimensionChoices or question
RetentionSession only, 30 days, or indefinitely
ScopePer user, per tenant, or global
WritesMay this segment persist memory?
User visibilityCan users inspect and delete their memory?

Retention determines how long information can influence future behavior; scope determines whose behavior it can influence. Write permission and user visibility answer separate questions about persistence and control. These choices shape both behavioral consistency and privacy. Gupta connects them to GDPR and the EU AI Act as governance motivations, without establishing that configuring them alone satisfies either framework.

8:298:42
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

8:29 · section reference included

Control action authority and make shutdown effective

Autonomy is the largest dial on an agent’s potential impact. Gupta uses three settings:

SettingAgent doesHuman does
SuggestRecommends an actionPerforms the action
Auto-approvePrepares the actionConfirms with one click
Auto-executePerforms the actionNo confirmation in this flow

Despite its name, auto-approve in this talk retains human confirmation. Moving to auto-execute removes that intervention point, so the setting should be an explicit grant of authority.

A kill switch must work agent-wide and per surface without a deployment, restart, or code change. Gupta gives it three requirements: the change takes effect in seconds; in-flight work observes it at its next decision point; and the wiring exists from the initial design rather than being patched in during an emergency. A dashboard toggle that only affects newly started sessions does not meet that contract.

The incident examples return here as motivation for interruptibility: LangChain-based loops, Pocket OS, and Replit all raise the question of where an operator could stop ongoing work. Gupta also briefly names OpenClaude, without developing another failure mechanism. The engineering requirement is a reachable interruption point, not an assumption that stopping later can reverse actions already completed.

9:109:24
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

9:10 · section reference included

Revoke email sending during a conversation

The first storyboard uses the Cursor Sam support scenario as its framing: a conversation is already underway, and the operator needs to intervene. The conversation appears on the left; the control appears on the right. Disabling the tool flag records who changed it, when, its scope, and the active sessions to which it applies.

After the flip, the agent says it cannot send emails right now, but offers to draft the message and copy it to the clipboard. Sending is unavailable; drafting remains an offered alternative. The storyboard demonstrates graceful tool denial within an active conversation. Revoking email permission does not itself establish whether a policy statement is true—the invented-policy scenario and the demonstrated execution control are distinct problems.

10:2210:38
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

10:22 · section reference included

Stop a runaway loop at its next decision point

The second storyboard returns to Gupta’s cited four-agent incident. His account places it in November 2025 and describes an eleven-day loop costing $47,000, detected by a billing threshold rather than the agent system. Those are reported incident details; the shutdown sequence that follows is explicitly an illustrative simulation.

In the simulation, baseline activity is 4–8 tool calls per minute before the runaway loop drives the rate upward. The intervention then follows a complete detection-to-shutdown sequence:

Simulation timeEvent
T+15 secondsRate guard sends a Slack alert
T+22 secondsOperator flips the agent kill switch
T+26 secondsIn-flight processes observe the flag and shut down gracefully
T+30 secondsCost graph flattens

The illustrated mitigation takes 30 seconds without a deployment, restart, or code change; it is not a measured production benchmark. The crucial mechanism is the check at each process’s next decision point: changing the flag only helps if ongoing work actually reads and obeys it.

Slide with a tool-calls-per-minute curve rising then falling, an emergency-stop panel marked pressed, and timeline entries for detection, alert, flag propagation, and graceful shutdown.Open full source frame
Illustrative kill-switch simulation showing tool calls falling and mitigation in 30 seconds without deployment.
11:2411:40
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

11:24 · section reference included

Put enforcement on every agent’s execution path

The architecture has three main parts: the user, a middleware layer, and the agent loop. Middleware resolves flags, gates tools, routes models, applies autonomy settings, and honors shutdown. The loop still contains its model, tools, memory, and sub-agents; the existing flag backend sits beneath the middleware. This adds an enforcement boundary without requiring a new agent loop or flag service. The named LaunchDarkly backend should not be confused with its current AgentControl quickstart, whose SDK examples are present-day implementation guidance rather than the demonstrated interface.

Every spawned agent must use the same middleware. An entry-point check is insufficient if a parent then creates a child that calls models and tools directly. The parent can obey every flag while the child bypasses the entire control layer—including the kill switch. Wire enforcement into every spawn and its execution path so descendants remain interruptible.

12:2712:47
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

12:27 · section reference included

Build the controls in operational order

The rollout playbook starts with emergency control, then adds finer distinctions:

  1. Ship shutdown first. Add one agent-wide kill switch and one per tool before the other controls.
  2. Wrap every tool. Resolve its flag before execution, not merely when constructing the tool list.
  3. Stage autonomy. Default to Suggest. Introduce human confirmation per surface as trust develops, and make auto-execute opt-in per tool.
  4. Make prompts selectable. Move system prompts into configuration resolved through flags.
  5. Watch the trends. Measure how behavior and mitigation change as exposure grows.

This order gives operators a way to stop the system before expanding the number of behaviors they can selectively release.

13:3513:49
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

13:35 · section reference included

Measure whether the controls work

Gupta proposes four operating metrics. The thresholds are suggested starting points to tune for the surface, severity, and traffic class, rather than universal service levels.

MetricSuggested target or response
Kill-switch activationsTarget zero per week; investigate more than two per week
Time to mitigationUnder five minutes for shutdown; under 30 minutes for prompt rollback
Canary error-rate deltaAt 5% rollout, block promotion if error rate rises more than 2% over baseline
Flag audit completeness100%: record who changed what and when

The canary threshold uses the talk’s stated 2%; it does not specify whether that means a relative increase or percentage points, so an implementation needs to define that comparison before automating promotion. The audit record serves a different purpose: reconstructing the intervention after an incident, including the actor and exact change.

14:1814:32
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

14:18 · section reference included

Five ways installed flags fail at runtime

Having flags is not the same as enforcing them. Five failures can leave the dashboard showing one policy while the agent follows another:

  • Session-start evaluation: A flag is resolved once, so a conversation already in flight misses a later shutdown. Reevaluate per turn and enforce tool permission before execution.
  • Children bypassing middleware: A spawned agent calls tools or models directly and escapes the parent’s controls. Every spawn needs the enforcement path.
  • Stale segmentation context: The user’s segment at the beginning of a conversation may no longer describe them later. Log segmentation context at the conversation level so targeting decisions can be reconstructed.
  • Caching that defeats a flip: An aggressive LLM gateway cache can return an old prompt response after the flag changes. The effective response behavior must agree with the selected configuration.
  • Silent shutdown: A kill switch activates, but nobody learns about it until much later. Gupta calls for a page on every activation.

That last prescription is stronger than the simulation’s claim that mitigation needed no incident-channel paging. Fast shutdown does not remove the need to notify the people responsible for the product.

15:2115:34
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

15:21 · section reference included

Make control demonstrable to buyers

Operational controls also become things a customer can ask to see. Gupta predicts that enterprise buyers will want demonstrations of five capabilities:

  • Shutdown: Show the kill switch working.
  • Prompt releases: Explain the rollout policy for instruction changes.
  • Isolation: Show how beta features stay away from production users.
  • Cohort mitigation: Demonstrate how quickly a model problem affecting one group can be contained.
  • Authority and audit: Identify who may change flags and show the resulting record.

The sales argument is that these should be observable product capabilities, not assurances about engineering intent.

Gupta also invokes the EU AI Act, Moffatt v. Air Canada, and Garcia v. Character.AI as legal motivations for greater control. Those brief references do not establish a general legal requirement to use feature flags or show that flags alone meet a legal obligation.

16:1516:24
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

16:15 · section reference included

Drill shutdown and retire temporary complexity

A kill switch can rot. It may work on the day it is added, then stop working after a configuration migration. Without drills, the first discovery of that breakage can be the incident in which the switch is needed. Shutdown is therefore a capability to exercise repeatedly, not a task completed once.

Flags can also become undocumented coupling between otherwise unrelated systems. Assign ownership and removal dates, and remove temporary rollout flags when the rollout finishes. That retirement rule applies to temporary release machinery; enduring shutdown controls still need to remain available and maintained.

Finally, test interactions. Six prompt variants can each work individually while their combined configuration produces a maze of behavior. Gupta calls for testing the Cartesian product of flag-driven prompt configurations: the question is not only whether each variant passes, but whether the combinations the system can select behave correctly together.

16:5717:12
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

16:57 · section reference included

Match release discipline to the agent’s authority

The immediate implementation priority is an agent-wide kill switch and a switch for each tool, effective without a deployment. From there, govern prompts, tools, models, memory, autonomy, and sub-agents independently, with activation frequency, mitigation time, canary deltas, and audit completeness showing whether the controls actually work.

Gupta frames 2026 as a period of adoption and forecasts 2027 as a period of control. The practical standard does not depend on that calendar: an agent that can send email, move money, modify databases, and spawn children deserves at least the rollout discipline already applied to an ordinary web application. His closing request is concrete: build the kill switch this week.

“Three things to remember” slide with three numbered boxes covering shutdown controls, independent behavior surfaces and measurement, and discipline proportional to blast radius.Open full source frame
Ship the kill switch first, govern the six surfaces independently, and match discipline to blast radius.

The recording closes by pointing to a curated collection of agent-failure case studies named vectra/awesome-agent-failures, extending the incident examples into further reading.

17:4717:59
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

17:47 · section reference included

Resources

From the talk

Updates since the talk

Transcript download
Full transcript

Loading transcript…