Server permissions
Read-only by default. Pick an access profile, and allow exactly the folders and services you want.
This page is about servers. A computer's permissions are chosen on its page in the dashboard: see Your computer.
The default: read-only, unprivileged
The agent runs as the system user opsgate in a hardened systemd sandbox. Out of the box it can:
- read what an ordinary user can read: configuration in
/etc, application folders that are world-readable, and logs (it is in theadmandsystemd-journalgroups), - run read-only commands from an allow-list (
ls,df,ps,git status,journalctl…), - check service status.
It cannot write files, restart services or run anything as root until you allow it. On top of that, these are always blocked: .env files, private keys (*.pem, *.key, id_rsa…), /etc/shadow, password managers, and the agent's own files.
Choose how much the AI may do: access profiles
sudo opsgate access # a menu: pick what the AI may do (also offered while installing)
sudo opsgate access readonly network # or name the profiles directly
| Profile | What it adds | Confirmation |
|---|---|---|
| readonly (always on) | Everything described below: read files, logs, services and databases. | — |
| network | curl to call APIs (GET/POST with the body typed in the command). No output files, no uploads, no @file, only http(s). |
Every use |
| asterisk | Asterisk reloads: dialplan reload, pjsip reload, module reload… (never core restart or originate). |
Every use |
| full | A root shell (run_shell), like an SSH login: any command, pipes, scripts, mysql with writes, asterisk -rx. |
Your AI app asks before each use; every call is in the audit log |
You can change it whenever you like — each profile only adds to the read-only base, and sudo opsgate access readonly takes everything back. Full access asks you to type FULL, adds a sudo rule for the agent's user and relaxes the service sandbox so a root shell works normally; switching it off removes both. Use it only on servers that are yours, and keep the connector sign-in protected (sudo opsgate 2fa on).
Let the AI edit files in a folder
sudo opsgate allow-write /var/www/myapp
sudo opsgate allow-write /etc/nginx/sites-available /etc/nginx/snippets
sudo opsgate deny-write /etc/nginx/snippets
This gives the opsgate user access through ACLs (your files keep their owner and permissions) and opens the folder in the systemd sandbox. Secret files inside it (.env, keys…) get an explicit no access entry. Whole system trees (/, /etc, /usr, /var, /home…) are refused: allow specific folders.
Even with write access, the AI must show you a diff and get your confirmation before every write, and a backup is saved in /var/backups/opsgate first.
Let it read a private folder
If a folder is not readable by ordinary users (for example /home/deploy/app with mode 700):
sudo opsgate allow-read /home/deploy/app
Let it restart services
sudo opsgate allow-restart nginx myapp
sudo opsgate deny-restart myapp
Each allowed service gets two exact sudo rules — systemctl restart <name> and a graceful reload (HUP to the main process) — in /etc/sudoers.d/opsgate, validated with visudo. Nothing else can run as root. Restarts also need your confirmation in the chat.
Databases (MySQL / MariaDB)
sudo opsgate db myapp_production
Creates the database user opsgate_ro@127.0.0.1 with SELECT only on that database and configures db_query. Queries are limited to SELECT, SHOW, DESCRIBE and EXPLAIN, one statement at a time.
Asterisk
If Asterisk is installed, asterisk_cli can run read-only commands (pjsip show …, core show channels, dialplan show …) through a root-owned wrapper that re-checks every command. With the asterisk profile it can also run reloads, each one after your confirmation.
See what is allowed
sudo opsgate permissions
Advanced settings
sudo opsgate config get
sudo opsgate config set MCP_READ_ROOTS=/opt/app,/var/log,/etc/nginx # limit reading to these folders
sudo opsgate config set MCP_RUN_ALLOWED="ls,cat,head,tail,grep,df,free,uptime,ps,git status,git log"
sudo opsgate config unset MCP_READ_ROOTS
| Setting | Default | Meaning |
|---|---|---|
MCP_READ_ROOTS |
/ |
Folders the tools may read (comma-separated) |
MCP_WRITE_ROOTS |
/ |
Folders the tools may write — the OS still limits writes to folders you allowed |
MCP_LOG_ROOTS |
/var/log |
Folders tail_log may read |
MCP_RUN_ALLOWED |
read-only commands | Commands run_command may run without confirmation |
MCP_RUN_CONFIRM |
git pull,git checkout,cp,mv,mkdir,touch,chmod,ln |
Commands that need confirm=true |
MCP_RATE_PER_MIN |
120 |
Maximum tool calls per minute, per connected app |
MCP_DENY_NAMES |
.env, keys… |
File name patterns that can never be read |
MCP_MAX_OUTPUT |
20000 |
Maximum characters returned per call |