# How do I let coding agents work on our servers without losing control?

Let Claude Code or Codex run commands on your servers through Valakes. Set a level for each host, approve changes one by one and read the audit log.

Source: https://valakes.com/use-cases/ai-agents-on-servers/

Last updated: 2026-11-29

Valakes gives each agent its own token and a level for every host: Off, Read-only, Approve writes or Full. Commands that change something wait in an approval card, and every call goes into an audit log. Saved passwords are filled in by Valakes and never handed to the agent.

Your team already uses a coding agent, and someone asked it to look at a server. Now there are questions. Which account does it use, and what did it run last night?

Valakes answers with settings you can see. It is plain about where they stop: an agent that can read a file can read it, and what it reads goes to its model provider. The article on [giving an AI agent SSH access](https://valakes.com/learn/ai-agents-on-servers/) shows what to set up on the server itself.

## Each agent has its own name and token

An agent gets its own name, handle and token, and you can pause, revoke or rotate each one separately. The agent API is off until you turn it on in Settings, and it listens on `127.0.0.1` only. The connect wizard shows the command to copy and the path of the token file. The token itself is never shown. See [Claude Code with Valakes](https://valakes.com/agents/claude-code/).

## You set a level for each host

Every host starts with agent access Off. In the host editor you choose Read-only, Approve writes or Full, and the two higher levels ask for a native confirmation. Read-only runs only commands from a short list of read commands, such as `ls`, `cat`, `grep` and `ps`.

That list is not a sandbox. It judges the text of one command, not what the command can reach, so for a production server give the agent a separate server account with no `sudo` and no secrets in its home folder.

## Changes wait for your approval

A call that needs you appears in the Agents panel with the exact command, the host, the directory and the risk Valakes found. Approve runs it once, Deny refuses it, and Take over moves it into your composer. An approval covers one command in one session and stops working if anything changes while it waits. An agent never gets the `Run anyway` button.

The kill switch turns the API off, cancels pending approvals and closes the sessions that agents opened. It does not undo what a command already did.

## You can read what ran

Settings, Audit log lists every call, approval, command and transfer, with the agent, the host and the time, and never a secret. Verify checks the chain of entries and says "Verified N entries" or "Chain broken". The log is tamper-evident, not tamper-proof. See [the AI agents page](https://valakes.com/features/ai-agents/).

## Guides

- [How do I let Claude Code work on my server without giving it the password?](https://valakes.com/guides/let-claude-code-run-commands-without-a-password/): Claude Code connects to Valakes, and Valakes makes the SSH connection. The agent never gets the passwords or keys you saved in Valakes, and a host stays closed to it until you open it.
- [How do I see what an AI agent ran on my servers?](https://valakes.com/guides/review-what-an-agent-did/): The Agents panel lists the latest calls of each agent. Settings, Audit log holds the full record, and Verify checks that no entry was edited, reordered or cut from the end.

## Read more

- [How do I give an AI agent SSH access with the least damage?](https://valakes.com/learn/ai-agents-on-servers/): Give the agent its own account on the server, with no sudo, no password in the prompt and nothing secret in its reach. Let it read first, allow root for one exact command at most, make every change wait for a person, and keep a record of what ran.
- [Which commands are safe to auto-approve for an AI agent on a server?](https://valakes.com/learn/auto-approve-agent-commands/): Only exact commands that read and cannot start another program. find, sed, awk, a redirection and ssh look like reads and are not, so a rule that allows them by name allows what they can do.
- [How do I keep an AI agent from deleting a production database?](https://valakes.com/learn/ai-agent-production-database/): Let the agent connect as a database role that has SELECT on the tables it needs and nothing else, so DROP, DELETE and TRUNCATE fail with a permission error. Keep the production password out of every file and variable the agent can read, give it a copy of the data to work on, and restore a backup once before the agent connects to production.
- [How do I let a user run one command with sudo?](https://valakes.com/learn/sudo-for-one-command/): Write a rule that names the command with its full path and exact arguments, put it in its own file under /etc/sudoers.d/, check it with visudo -cf, and install it with mode 440. Do not use wildcards in the arguments, and do not allow editors or any program that can start a shell.
- [How do I keep a command running after I close SSH?](https://valakes.com/learn/keep-commands-running/): Start it inside tmux (tmux new -s name, then Ctrl-b and d to leave). If tmux is not there, put nohup in front of the command and an ampersand after it. When a terminal closes, the programs started in it get a hangup signal and stop, and both tools get around that.
