Guardrails for AI agents in the cloud: permissions, approvals, budgets

Guardrails for an AI agent in the cloud are the limits that decide what it can touch, what it must check first, when a person must say yes, and how much it can cost. In practice they are narrow, expiring permissions; a confined area of work; dry runs and safe retries; human approval for risky steps; budgets and alerts at the cloud provider; and a record of every action.

Published

Why do agents need guardrails of their own?

A person who creates a machine by mistake usually notices. An agent may not. It works fast, it can repeat a step when a call times out, and it acts on its understanding of a request, which may differ from yours. None of this makes agents unsafe to use. It means the limits have to be in the system, not in the agent’s good intentions.

Good guardrails share one property: they are enforced outside the agent. The agent can be told to be careful, but the token, the cloud and the process decide what is actually allowed.

Permissions: give the least, for the shortest time

Permissions are the first and strongest guardrail.

  • One token per agent. Separate tokens let you see what each agent did and revoke one without the others.
  • Start read-only. Many useful tasks, such as “what is running where?”, need nothing more.
  • Separate create from delete. An agent that creates and deploys rarely needs to delete. Keep deletion as a separate permission.
  • Never give an agent administrative rights. Adding cloud accounts, managing people and issuing tokens are jobs for people.
  • Set an expiry. A token for a week-long project should expire in a week.

In Mayadyn, tokens carry the scopes read, write and destroy (plus admin, which no MCP tool needs), can be set to expire (the console offers 7, 30, 90 or 365 days), and are capped by their creator’s role. Agents cannot read credentials, connect cloud accounts or manage members and tokens.

Confine the area of work

Limit where the agent can act, not only what it can do. In Mayadyn, a token can be limited to one project, so it sees only that project’s cloud accounts, machines, apps and operations. In the cloud itself, the same idea applies at the level of accounts, projects, subscriptions or compartments: give the agent’s area its own unit, separate from production.

Check before acting

  • Dry runs. Ask the agent to validate a change before making it. A dry run reports what would happen and changes nothing. Mayadyn supports dry runs for creating, starting, stopping and deleting machines and for deploying apps.
  • Idempotency keys. When a call times out, the agent retries. With an idempotency key, the retry returns the first operation instead of doing the work twice, so you never get a second machine.
  • One change at a time. Mayadyn runs one change at a time per machine, so two requests cannot collide on the same resource.
  • Wait for the result. Long changes should return an operation the agent waits on, rather than an assumption that it worked.

Approvals: put a person on the risky steps

Some actions deserve a human yes: deleting anything, deploying to a public address, or creating resources in a new region. Approvals are a practice you build around the agent:

  • In the agent client. Many agent applications can ask the user to confirm before each tool call, or before calls that change things. Keep that on for change tools.
  • By splitting tokens. Give the agent a read-only token by default. Issue a short-lived token with more permissions for a specific, agreed task, and revoke it afterwards.
  • By process. For production, route changes through your existing change requests: the agent prepares and dry-runs, a person approves, and then the change runs.

Budgets: limit what it can cost

Cost control happens mostly at the cloud provider, not in the agent:

  • Budgets and alerts. AWS, Azure, Google Cloud and Oracle Cloud all let you set budgets that alert you when spending passes a threshold. An alert does not stop spending by itself.
  • Quotas and limits. Cloud quotas cap how many machines or how much capacity an account or project can use. A small quota on the agent’s area is a hard ceiling.
  • Small sizes by default. Agree which sizes the agent may use, and say so in your instructions.
  • Stop what is idle. Ask the agent to stop test machines at the end of the day; a stopped machine keeps its disk.
  • Labels. Label what the agent creates so you can find it on the bill.

Records: know what happened

Every agent action should leave a trace tied to a person. In Mayadyn, the audit log records every change and every refused request, with the token owner’s name and a mark that it came through a token. It also records each use of stored credentials. Compare it with your cloud’s own audit logs, and review it regularly in the first weeks.

A starter checklist

  1. One token per agent, read-only to start, with an expiry.
  2. No delete or admin rights unless a task needs them.
  3. The agent works in its own project or account.
  4. Dry runs before changes; idempotency keys on retries.
  5. Confirmation in the agent client for change tools.
  6. A budget alert and a quota on the agent’s area.
  7. A weekly look at the audit log.

Set up an agent with these limits using the cloud for AI agents page.

Questions people ask

What is the single most important guardrail?

Least privilege. An agent that cannot delete cannot delete by mistake. Start read-only and add permissions only when a task needs them.

Can a cloud budget stop an agent from overspending?

Budgets in the major clouds mainly send alerts when spending crosses a threshold. To stop spending you need limits on what can be created, automation that reacts to the alert, or a person who acts on it.

Does Mayadyn record what an agent did?

Yes. Every change appears in the audit log as the token's owner, marked as done through a token, and refused requests are recorded too. See Security and governance.

Connect your first cloud account in minutes

Create a workspace, connect Oracle Cloud or Google Cloud without handing over a key, and run your first machine. You pay only for what you use.