Guide / AI agent production access
AI agent production access without the delete key
Updated
If your agent deleted your production database tonight, how long until you'd know, and could you get it back? Most teams that let a coding agent near their cloud do it the fast way: paste an API token into the agent's environment and hope. That token can deploy. It can also delete every database the account owns, and the agent will use it the moment a prompt like "clean up the old resources" points that way. The alternative is not to keep agents out of production. Agents are good at the tedious parts of running software: reading logs, redeploying, rolling back, running a migration at the right moment. The alternative is to give them real power with a human checkpoint in front of anything that can't be undone. This is how Resilis does it.
Connect the agent as a person, not as a token
Claude Code and Codex connect to Resilis through its MCP server at https://mcp.resilis.io. MCP, the Model Context Protocol, lets an agent discover and call a defined set of tools.
Shell
# Claude Code
claude mcp add --transport http resilis https://mcp.resilis.io
claude mcp login resilis
# Codex CLI
codex mcp add resilis --url https://mcp.resilis.io
codex mcp login resilis Login opens a browser. You sign in to Resilis, choose the organization, and review the access the agent is asking for. There is no long-lived key to paste or leak. The agent then acts within your organization access, and you can disconnect it from Settings → Agent access at any time.
What the agent can do
Connected agents get tools for the work that keeps an app running:
| Area | Examples |
|---|---|
| Deploy | Deploy a local workspace or a GitHub repository; redeploy; restart |
| Observe | Deployment status, build and runtime logs, metrics |
| Recover | Roll back to an earlier deployment; snapshot or restore a database |
| Configure | Environment variables and secrets, custom domains, database bindings |
| Operate | Run migrations and other one-off commands as bounded release jobs |
Secrets stay out of the conversation. Deployment records come back with secret values redacted. When an agent attaches a database to an app, databases.bind writes the connection string into the app's environment without returning it to the model.
What the agent cannot do: delete directly
There is no delete tool. Deletion is a workflow, and the agent can only start it:
- 1. Prepare. The agent calls resources.deletion.prepare. Resilis works out the impact: the resource, its environment, whether it holds persistent data such as a database or storage, and whether a custom domain will stop serving. Nothing is deleted.
- 2. Approve. A person reviews the request. Agent deletion requests appear under Settings → Agent access → Resource deletion approvals, where an owner or admin can approve them after reading the impact.
- 3. Schedule. Only after approval can the agent call resources.deletion.execute. That schedules the deletion; it does not run it.
- 4. Cancel window. A 10-minute cancellation window opens. An owner or admin can cancel during it, and so can the agent that asked.
Requests that sit unapproved expire after 15 minutes. If the resource changes after the request is prepared, the request goes stale and must be prepared again. An approval always matches exactly what was reviewed.
Production adds an owner's email
Production gets a second layer. Deleting or stopping a production resource, whether a person or an agent asks, sends an approval email to the organization's account owners:
- Opening the link does not approve anything. The owner signs in and chooses Approve or Reject.
- The link expires after 30 minutes and works once.
- The approval is tied to the exact target and its state. If the target changes in the meantime, the approval is refused as stale.
- Any current owner with a verified email can approve. The person who asked does not get to skip it, and platform administrators have no bypass.
Resources in environments with custom names are protected the same way as production. The protection fails closed.
Every agent call is recorded first
Before any tool runs, Resilis writes an audit record: who made the call, through which agent client, which tool, a fingerprint of the arguments, then the outcome and duration. If that record cannot be written, the call is refused. An unrecorded agent action does not happen. The records are kept for support and investigation.
Delete permissions expire quickly
The permission to carry out deletions is short-lived. The permission to execute an approved deletion lapses five minutes after you grant it, so a long-running agent session does not keep it by accident. To schedule an approved deletion later, reconnect the agent and grant the permission again.
The "clean up" story
Here is how it plays out. A developer asks their agent: "Clean up the resources we're not using in this project."
The agent lists resources and finds an old app in development, a test database in staging and, mistakenly, the production database. It prepares three deletion requests. Each comes back with an impact summary. The production database request comes back marked as needing an owner's approval, and an email goes out.
The owner opens the email, sees "delete" next to the production database's name, and rejects it. The development and staging requests appear in the approval queue, where the developer approves the two that were genuinely unused. The agent schedules them, and they are deleted after the cancellation window.
Nothing irreversible happened without a person deciding it should.
Where the human checkpoint is today
Be precise about the boundary. Approvals today cover deletion of any resource by an agent, and deletion or stopping in production by anyone.
Some recovery actions are deliberately available to agents without an approval, because they are how you fix things quickly: rollback, restart, redeploy and database restore. An in-place database restore replaces current data, so the tool requires an explicit confirm_inplace flag, and a fork restore is always available as the safer choice. Treat these as actions you approve in your agent's own permission prompt, and keep your agent's client-side approvals on for them.
A working policy for your team
- Connect each developer's agent with their own sign-in. Do not share connections.
- Ask for a plan before any change: "Show me the project, environment and resource you will change. Do not start until I approve."
- Let agents deploy, observe and roll back in every environment.
- Keep the people who should approve production deletions as account owners, and nobody else.
- Turn on continuous backups for production databases (Pro), so even an approved mistake can be undone to the minute.
Frequently asked questions
Can an AI agent delete my production database on Resilis? Not on its own. The agent can prepare a deletion request. Production deletions need an account owner to approve by email, and an approved deletion still has a 10-minute cancellation window.
Do I need to give my agent an API key? No. Claude Code and Codex sign in through OAuth in the browser. You review the requested access and can disconnect the agent from Settings at any time.
Can the agent see my database password? Not when it binds a database with databases.bind. The connection string goes into the app's environment as a secret and is not returned to the agent.
Are agent actions logged? Every agent tool call is recorded before it runs, with the person, agent client, tool and outcome. If the record can't be written, the call does not run.
Does this slow down normal deploys? No. Deploys, rollbacks, restarts and log reads do not wait for approval. Only the irreversible actions do.