Skip to content

Running AI agents safely with the ADK

How REM CloudHub keeps agents inside their limits: permissions that need three yeses, approvals that pause one thread, budgets that fail closed, a watchdog on progress, and secrets that never reach the model.

3 min read

An AI agent that can call tools is a program that writes its own next step. That is what makes it useful, and it is why "the model will behave" is not a security model. In REM CloudHub every agent, whether built in the console or written with the agent kit (ADK), runs under the same set of rules. Here is what they are and why each one exists.

Three yeses for every tool call

An agent's effective permission is the agent's own permissions AND the person it works for AND its holder (the person who deployed it). A deny from any of them wins.

Agent may

Person may

Holder may

Result

read only

anything (even a super admin)

anything

read only

everything

read only

anything

read only

everything

nobody (a scheduled run)

write

what the holder may do

anything

anything

removed from the organisation

the run pauses

There is no superuser path: a powerful person cannot lift a read-only agent, and a powerful agent cannot lift a read-only person. This is checked on every tool call: your own tools, MCP tools, built-in file tools, and every sub-agent, which runs under the same checks as its parent. Once an agent has a permission map, a tool with no declared requirement is denied rather than allowed.

Approvals that pause one thread

Some actions should wait for a person: publishing a report, writing to a production database, sending a mail. Mark them as approvals (approvals = ["report:write"] in agent.toml, or Needs a person's yes in the console). A matching call pauses only that run's thread; the agent's other runs carry on. The request shows under Waiting for your yes and expires after 24 hours. The approval is asked only after the permission check passes, so nobody is asked to approve something that would be refused anyway, and permissions are checked again when the answer comes back.

Budgets that fail closed

Every run has limits by default: 200 model calls and one hour of active work. You can add a spend limit in dollars, an end date after which no model call is made, and a cap on steps per turn. A spend limit on a model with no known price refuses to run rather than guessing. At 80% of any budget the agent is told to wrap up. In the console, agent spend is paid from your organisation's REM Credits and shown per agent.

A watchdog on progress, not on liveness

A stuck agent often still answers health checks. The watchdog therefore watches progress: model calls, tool calls, sub-agent work. A heartbeat alone does not count. No progress for five minutes and the turn restarts from its last checkpoint; three failures in a row and the agent pauses and raises an alert. Because every step is checkpointed, a crash or a restart continues the run where it was, without repeating finished work.

Secrets never reach the model

Tool output is redacted before the model sees it: values of environment variables whose names contain KEY, TOKEN, SECRET or PASSWORD, and known shapes such as private keys, API keys, JWTs and credentials in URLs, become [REDACTED]. Telemetry events are redacted before any sink, and prompts are not recorded unless the agent is explicitly granted full capture. In the console, an agent's secrets come from the Vault as variables; their values are shown once at creation and never again.

Closed by default

An agent's sandbox reaches nothing on the network until you allow a host and port under What it may reach. Over MCP, write tools answer with a preview and a confirm code first, and your organisation's MCP access policy can require confirmation or deny any tool for any person, group, token or agent. Pause stops an agent; Stop for good stops every run at once and revokes its tokens.

What the rules cannot do

The kit enforces every tool call. It cannot control what the code inside an allowed tool does: a tool that opens its own network connection is not stopped by a permission map. Review the tools you give an agent as you would any code, and give each agent the narrowest permissions that let it do its job.

Try it

Create an agent under AI > Agents, or write one in a single file with the agent kit. The Agents guide covers the console step by step.

Subscribe to the newsletter

New posts and product news from REM CloudHub, a few times a month. Nothing else.