AI-native

How do you stop an AI agent from switching on an unfinished feature?

Put the unfinished code behind a feature flag and tell the flag service it isn't ready. In Flagger.gg, a not-ready hold blocks anyone from turning the flag on without an explicit confirmation, and only a person or an admin token can lift it. For flags an agent should never flip, mark them protected so agents can only kill them, and turn on approvals so wide changes wait for a person.

Updated November 25, 2026

Why can an agent turn a feature on at all?

Because that's usually its job. A coding agent that ships its own changes creates flags, targets testers and rolls them out. In Flagger.gg's default auto-live mode, an agent's changes apply at once, within the actions on its token, and a newly registered flag starts on unless it carries a not-ready reason. That's what you want for finished work, and the wrong thing for work that isn't done. See what permissions an AI agent should have.

How do you mark work as not ready?

Two ways, from Flagger.gg's guides:

  • A not-ready reason in code. The change that adds the flag declares it with a reason it isn't ready, so the flag starts off in auto-live mode and the agent can merge unfinished work safely. Turning a not-ready flag on needs an explicit confirmation, and bulk changes refuse it. See trunk-based development with AI agents.
  • A not-ready hold. Set in the flag's drawer in the console, or through the API, with a reason. While it's held, turning the flag on needs that confirmation from whoever asks, bulk changes refuse it, and a code deploy can't clear it. An agent can set a hold, but only a person or an admin token can clear one.

What about flags an agent should never touch?

Mark them protected. A person switches on Protected in the flag's drawer, typically for paths such as payments and sign-in. Agents can then only kill a protected flag: they can't turn it on, change its rollout or edit its description, and with approvals on, anything else they ask for becomes a request for a person. The kill stays open on purpose, so an agent can still turn a bad change off fast. See kill switch or rollback.

How do approvals fit in?

Approvals are off by default. Turn them on in a project's settings and each environment gets an agent cap, 10% in production and 100% in development by default. Agents can roll a flag out up to the cap; anything wider, or turning it on for everyone, becomes a request that a person approves in the Release console, and agents have no approve tool. Give each agent's token the request action, so a change past the cap becomes a request instead of failing, and tell the agent to stop and report the request rather than retry. See adding human approval to AI agent actions.

Which should you use?

SituationUse
The code isn't finished yetA not-ready reason in code
A person wants to stop anyone switching it on for nowA not-ready hold
Payments, sign-in and other critical pathsProtected
Wide production rollouts by agentsApprovals with a cap

Every agent write still needs a note, so the audit log shows which agent changed what and why; see how to tell which AI agent made a change.

Frequently asked questions

Can an AI agent turn on a feature flag in Flagger.gg?

Yes, in the default auto-live mode, if its token has the rollout action. A not-ready hold, a protected flag or approvals stop it.

Who can clear a not-ready hold in Flagger.gg?

Only a person or an admin token. An agent can set a hold but can't clear one, and a code deploy can't clear it either.

What can an agent do to a protected flag?

Only kill it. Every other change is refused, or with approvals on becomes a request for a person.

What is the default agent cap with approvals on?

10% in production and 100% in development, set per environment in the project's settings.