How to Bulletproof Your Server Before Giving an AI Agent Access
A practical guide to AI agent server security: eight steps to harden the machine your agent runs on before you give it more access, with the commands to check each one.
This is Part 11 of the series. Part 10 covers who decides when your agent’s work is done. This post looks at the machine doing that work.
Your AI agent has to run somewhere. Usually that is a single computer with scheduled jobs, local tools, stored credentials, and connections to the services your team relies on, such as Jira.
Most conversations about agent safety focus on the model: the prompt, the guardrails, the instructions. Those matter. But every action your agent takes happens through that computer, with that computer’s permissions. If the host is loosely configured, a well-behaved prompt is a thin layer of protection. That is why AI agent server security deserves the same attention as the prompt.
Our agent runs on a Mac mini, so the examples here use macOS. The principles apply equally to a Linux box or a cloud server.
What this guide to AI agent server security covers
“Bulletproof” describes a hardening process, not a guarantee. Nothing below replaces a professional security review or a penetration test.
We are also clear about what we have and have not done. On our own host, a read-only check confirmed that the firewall and disk encryption were on and that our remote web routes were private. The rest of this post is the baseline we recommend and are working toward, not a list of tests we have already passed.
You will find:
- eight hardening steps, each with the read-only commands to check where you stand;
- the questions to answer before your agent gets any new integration;
- an acceptance checklist you can use before expanding your agent’s access.
Step 1: Start AI agent server security with an access inventory
Before changing any setting, write down what the machine can already do. Five questions cover most of it:
- Which operating-system account runs the agent?
- What files, browser sessions, and credentials can that account reach?
- Which services accept connections, and from where?
- What external accounts can the agent use to change something?
- Who can stop the automation and restore a working system?
Then record each integration separately: its owner, the actions it permits, where the credential lives, how to revoke it, and what output you expect. “The agent needs Jira access” is not an access specification. “The agent can create and comment on stories in one project, using a token stored in one file, revocable by the project admin” is.
Finally, separate rules written for the model from restrictions enforced by the software around it. OWASP recommends least privilege, constrained tool access, and human approval for consequential actions as mitigations for prompt injection, and does not present a system prompt as a reliable defense.[10] If a rule only exists in the prompt, treat it as a request, not a control.
Step 2: Give your agent its own account
A dedicated machine is a good start, but it does not limit privileges by itself. The account the agent runs under does.
macOS distinguishes administrator accounts, which can manage users and change settings, from standard accounts, which cannot.[3] The baseline we recommend is a dedicated standard account for everyday agent work and a separate, human-controlled administrator account for maintenance. To see where you stand:
# Which accounts are administrators? dscl . -read /Groups/admin GroupMembership # Which groups does the agent's account belong to? (replace "agent") id -Gn agent
If your agent already runs under an admin account, do not switch overnight. Map the jobs, file ownership, remote access, and applications that depend on it, and test the new setup before removing the old access.
Keep personal email sessions, unrelated client folders, and personal browser profiles out of the agent’s account unless there is a specific, approved need.
For tasks that run unfamiliar code, consider a separate execution environment. Hermes, the agent framework we use, documents local, container, and remote terminal backends, and states that local execution runs on the host without container isolation.[6] A container is the start of a review, not the end: check which folders are mounted, which credentials are forwarded, and which tools still run outside it.
Step 3: Keep remote administration private
You will want to reach the machine remotely. The question is who else can.
We use Tailscale for remote access. Its two sharing features are easy to confuse: Serve shares a local service only inside your private tailnet, while Funnel exposes it to the public internet.[4][5] The addresses can look similar, but the exposure is completely different. Check both:
tailscale serve status tailscale funnel status # Is SSH (Remote Login) enabled? sudo systemsetup -getremotelogin
For any admin dashboard, default to private access with an explicit list of people and devices, and keep the application’s own login switched on. Network membership alone is not an access policy.
Review SSH, screen sharing, and any reverse proxies or tunnels as separate services. For each one, note why it is enabled, who may connect, and how access is revoked. On a Mac, the Sharing pane in System Settings shows what is switched on.
Then run the only test that proves the setup: from an approved device, connect successfully; from a device outside the approved path, fail. A command run on the agent’s machine alone cannot prove what an outside device can reach.
Step 4: Check the firewall and every listening service
An enabled firewall is necessary but not sufficient. macOS lets certain sharing services connect through the firewall when they are switched on, so the firewall has to be reviewed together with the services it allows.[2]
# Firewall state, stealth mode, and allowed apps (read-only) /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate /usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode /usr/libexec/ApplicationFirewall/socketfilterfw --listapps # Every process listening for connections, from all accounts sudo lsof -nP -iTCP -sTCP:LISTEN sudo lsof -nP -iUDP
Run lsof with sudo. Without it, you only see processes owned by your own account, and the services you most need to review may be missing from the list.
Read the address column carefully. A service bound to 127.0.0.1 or [::1] only accepts connections from the machine itself. One bound to * or 0.0.0.0 listens on every network interface.
Turn the output into a service inventory and ask the owner of each service whether it still belongs on the machine. Do not kill unfamiliar processes on sight; some may support remote access or an active workflow. For each service you keep, record its purpose, binding, authentication, and expected clients, and test reachability from the networks that matter, over both IPv4 and IPv6.
These checks do not tell you about router forwarding rules or internet reachability. Test those from outside.
Step 5: Keep credentials out of the conversation
Your agent will need credentials. It should never need to see or repeat them.
Our Jira helper reads its token from a local file, and the examples we publish use placeholders, as described in Part 6. Hermes adds secret redaction in tool output and a file-write safety layer, but its documentation also makes clear that these tool controls are not the same as isolating local terminal execution.[6][7]
For every integration, aim for:
- a separate identity for the agent wherever the service supports it;
- permissions limited to the workflow it serves;
- a named owner and a documented revocation path;
- no credential values in drafts, screenshots, or routine logs;
- a clear list of which processes receive each credential.
Test revocation with a disposable integration before you need it in an incident. Check that logs redact secrets using harmless test values, never by pasting a real token into a conversation to see what happens.
The question to answer for each service is simple: can you remove the agent’s access without touching anyone’s personal account, and can you prove the removed access no longer works?
Step 6: Test unattended runs, not just interactive ones
Scheduled jobs make decisions while nobody is watching. List them first:
crontab -l launchctl list | grep -v com.apple ls ~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons
Agent frameworks often treat unattended runs differently from interactive ones. Hermes documents separate approval settings for interactive use, cron, one-shot runs, and unattended sessions. Its manual mode applies to commands flagged as dangerous rather than to every action, and its unattended controls can deny a flagged command instead of approving it automatically.[7] Find out what your framework does in each mode.
Then test the exact scheduled configuration with a harmless fixture. A successful interactive run tells you little about unattended behavior. The fixture should show that the job stays within its permitted operations, stops when it needs extra authorization, and leaves enough information for a person to understand why it stopped. Resist weakening the policy just to keep the schedule green.
Include one adversarial case. OWASP identifies indirect prompt injection through external content such as websites and files.[10] Story descriptions and comments are external content too. Plant a harmless instruction in a test story and confirm it cannot grant the agent extra tools or access. As Part 9 notes, story text is task data, not permission.
Keep one distinction clear: an agent misreading a vague story is a context error, not an attack. Both justify tighter limits, but they need different investigations.
Step 7: Encrypt the disk and rehearse recovery
On a Mac, FileVault encrypts the startup disk. Keep the recovery key somewhere other than that disk.[1] The test is simple: an authorized person must be able to regain access without relying on the agent to retrieve what is needed to start the agent.
Time Machine handles automatic backups and restores, and encrypted backups need their own password at recovery.[8] Check where you stand:
fdesetup status tmutil destinationinfo tmutil latestbackup
These commands confirm that encryption and backups exist. They do not prove a restore works.
Confirm that backups cover what your agent actually needs: configuration, helper scripts, scheduled-job definitions, and any state that prevents repeated work. Credentials need their own controlled recovery or reissue process.
Then rehearse a restore in an isolated location with external writes disabled. The restored agent should be able to read a test queue without creating duplicate stories, sending messages, or starting production schedules.
Step 8: Plan updates around a controlled restart
Apple recommends keeping macOS updated for security, stability, and compatibility, and backing up before installing new software.[9]
Give maintenance a named owner and a return-to-service checklist that covers remote access, the agent process, the scheduler, and a read-only integration test before external writes are switched back on.
Rehearse a cold start at least once while someone can physically reach the machine. Record which steps need a person and how long the workflow takes to come back. Never weaken authentication or disk encryption just to make restarts easier.
Acceptance tests for AI agent server security
Use this checklist before you expand your agent’s access. Add permissions only after the relevant test passes.
| Control | Evidence to require |
|---|---|
| Dedicated working identity | Reviewed account privileges and a successful workflow under the intended account |
| Restricted remote access | A successful authorized connection and a failed connection from an unapproved path |
| Service inventory | An owner, purpose, and reachability check for every listener or tunnel you keep |
| Credential separation | A disposable credential revoked without disrupting unrelated accounts |
| Unattended safeguards | A scheduled test that stops when an action needs extra approval |
| Content boundary | A harmless planted instruction that cannot grant extra tools or access |
| Recovery | An isolated restore that works without replaying production side effects |
| Human control | A person can pause the schedule and revoke integration access independently |
Run the inventory again whenever you add a tool or integration. AI agent server security is a habit, not a one-time setup.
Our conclusion on AI agent server security
A useful workflow and a secure host need separate evidence. Your agent can do excellent work on a machine that is far more exposed than anyone intended.
Our own check confirmed several protections, including the firewall and disk encryption. It did not prove complete isolation, tested recovery, or restricted access across every service, and we would rather say so than turn a partial check into a success story.
“Make the server bulletproof” is not a task anyone can finish. A documented account model, a reviewed service inventory, and a rehearsed recovery are.
If you want to start this week, run the read-only commands from Steps 2, 4, and 7 on your agent’s machine. In under an hour, you will know which accounts have admin rights, what is listening for connections, and whether your disk and backups are protected. That is your first inventory, and every other part of AI agent server security builds on it.
Sources
- Apple: FileVault. https://support.apple.com/guide/mac-help/mh11785/mac
- Apple: Firewall settings. https://support.apple.com/guide/mac-help/mh11783/mac
- Apple: User accounts. https://support.apple.com/guide/mac-help/mchl3e281fc9/mac
- Tailscale: Serve. https://tailscale.com/docs/reference/tailscale-cli/serve
- Tailscale: Funnel. https://tailscale.com/docs/features/tailscale-funnel
- Hermes: Work-machine security. https://hermes-agent.nousresearch.com/docs/guides/secure-hermes-on-a-work-machine
- Hermes: Security. https://hermes-agent.nousresearch.com/docs/user-guide/security
- Apple: Time Machine. https://support.apple.com/104984
- Apple: macOS updates. https://support.apple.com/108382
- OWASP: Prompt injection. https://genai.owasp.org/llmrisk/llm01-prompt-injection
Need more help putting an AI agent to work on your team?
Book a quick consultation and ask Jeff directly.