How to Configure Amazon Q SSH Sandbox

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up an amazon q ssh sandbox by pairing restricted Linux users with OpenSSH certificates. Then you route AI agent shell commands to an isolated host instead of production servers. Teams often let coding agents use the local SSH keys on a developer laptop. When permissions are too broad, a bad prompt can change live systems or read secrets. Building a dedicated sandbox limits the blast radius when the agent runs remote shell tasks. How to set up an amazon q ssh sandbox with OpenSSH First

SSH Access Management + AI Sandbox Environments: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up an amazon q ssh sandbox by pairing restricted Linux users with OpenSSH certificates. Then you route AI agent shell commands to an isolated host instead of production servers. Teams often let coding agents use the local SSH keys on a developer laptop. When permissions are too broad, a bad prompt can change live systems or read secrets. Building a dedicated sandbox limits the blast radius when the agent runs remote shell tasks.

How to set up an amazon q ssh sandbox with OpenSSH

First, understand how the AI agent runs commands on a developer workstation. Amazon Q Developer runs local shell commands using the developer's active terminal profile. When the agent runs an SSH command, the local client reads the local key store. If your personal key can log into production, the agent can log in too.

To isolate the agent, build a dedicated target host with a locked-down Linux account. Remove root rights from this account and limit file permissions to one work folder. Next, replace static public keys with OpenSSH user certificates signed by a Certificate Authority key. OpenSSH added certificate support in version 5.4, using a simpler format than X.509 certificates. Each signed certificate holds a public key, identity info, principal names, and specific options.

Always set a short validity window when you sign a user certificate for the sandbox. Make sure the principal name on the certificate matches only the sandbox Linux user. You can also bake command restrictions into the certificate options before handing it out. Point the agent workspace at a host alias that uses this short-lived certificate. Now, when the agent opens a remote shell, it lands inside the isolated host.

Why native SSH setup leaves a runtime gap

Using a dedicated host and signed OpenSSH certificates solves the initial login problem. It keeps the AI agent off production nodes and removes long-lived static keys from laptops. You also get clear logs showing which signed key identity opened a remote session.

Still, native SSH controls only check who can log in at the start. Once the shell session opens, the remote host runs every command the user account allows. Native OpenSSH forced commands are rigid and lock the session to one fixed script. If an agent needs to inspect logs and check processes, a single forced command fails. So teams usually grant an interactive shell inside the sandbox instead.

SSH Access Management + AI Sandbox Environments: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

An open shell creates two big blind spots for security and platform teams. First, you cannot inspect or block individual risky commands in flight during the session. If the agent tries to delete shared test data, the Linux shell just runs it. Second, if the sandbox holds sample customer records, raw output flows straight into the agent. Native SSH cannot rewrite sensitive fields like emails, phone numbers, card numbers, or national IDs. Without command-level checks and data masking, even a sandbox can leak test secrets or break.

Separating agent credentials from developer keys

A strong setup keeps developer keys and agent keys in separate folders on disk. Developers often keep forwarding turned on in their main SSH config file for daily work. Agent forwarding lets a remote server use your local keys to hop to other hosts. If an AI agent logs into a sandbox with forwarding on, that boundary breaks. Anyone on the sandbox could use the forwarded socket to reach other servers.

Turn off agent forwarding and port forwarding in the certificate options for the AI profile. Keep the agent SSH config file minimal and point it only to the isolated host. Clear out local keys after the task finishes so no active credentials sit on disk. This habit keeps your daily work separate from automated agent tasks.

Inspect one-shot SSH commands and file tasks

SSH certificates and host rules decide who is allowed on a machine. Setup alone does not check single commands or block sftp reads on sensitive paths. By design, hoop.dev runs an open-source SSH listener on the host where people and agents keep their normal ssh, sftp, and scp tools.

First, hoop.dev guardrails check one-shot commands and file paths before they run. Next, hoop.dev data masking masks matched values in file downloads. The audit trail logs the certificate principal, requested action, and verdict without storing session content. Interactive shells carry no guardrails and can be turned off when every action must be checked. Explore the code on GitHub.

Frequently asked questions

Can Amazon Q Developer use my local SSH keys?

Yes, when the agent runs terminal commands, it uses your active local shell user. If your SSH agent has loaded keys, the tool can use them unless you separate configs.

How do OpenSSH certificates help secure an agent sandbox?

OpenSSH certificates let a Certificate Authority sign keys with a set identity and expiration time. You can also lock the certificate to specific user principals and turn off port forwarding.

Why is a separate Linux user not enough for AI agents?

A separate Linux user restricts file permissions on that single host after login. It does not block risky commands in flight or rewrite emails and card numbers in output.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.