# Server Operations That Ask for a Name, Not a Command

> Giving an AI tool the ability to change servers is easy. Making sure it can only change them the way you intended is the work. DevOps & SRE Intelligence lets TicketResolve restart, scale and roll back, but only operations your agent declares, an admin allowlists, a policy engine passes and a named person approves. Destructive operations don’t exist.

Source: https://www.ticketresolve.ai/blog/server-operations-that-ask-for-a-name-not-a-command · Published 2026-11-17 · TicketResolve AI

A mid-sized e-commerce company connects an AI operations assistant to its servers through SSH. The pitch is appealing: the AI investigates an alert, works out what's wrong and fixes it, while the on-call engineer sleeps.

For two weeks it works well. It restarts a stuck worker, clears a cache, rotates a log file.

Then, at 04:20 on a Sunday, disk usage on the database server hits 95%. The assistant investigates, finds large files in `/var/lib/postgresql/14/main/pg_wal`, decides they're "old logs", and deletes them. They were the database's write-ahead log. The database refuses to start. The on-call engineer is woken by the outage, not by the alert.

Nobody told the AI it could delete files. Nobody told it that it couldn't, either. With SSH access, any command was possible, and the AI chose one that seemed reasonable.

Giving an AI tool the ability to change servers is easy. Making sure it can only change them the way you intended is the work.

## First, the basics

- **The agent** is TicketResolve's small program on your server. It connects outbound over HTTPS and runs only what you allow.
- **An operation** is a change to a server: restart, reload, scale, roll back, deploy. **Declaring** it on the agent gives it a name and the command, written by you, on your server.
- **An allowlist** is the list of operations permitted for each server.
- **Levels**: **Level 1** is read-only checks; **Level 2** is routine changes; **Level 3** is significant changes; **Level 4**, destructive operations, **doesn't exist**.
- **A policy engine** checks every request against rules before it can run.
- **Approval** is a named person agreeing. **Production** servers need someone with production approval rights.
- **Verification** is a read-only check after the operation, confirming it worked.
- **A rollback** undoes an operation. **An emergency stop** pauses all operations at once.
- **A runbook** is a series of steps for handling a situation.
- **Injection** is sneaking extra commands into a request.

**Why does this matter?** Automation on servers can save hours at night, but one wrong command can cause an outage. The safe way is to make the dangerous things impossible, not just discouraged: the command is written by you, permitted by an admin, checked by rules, approved by a person, and verified afterwards.

## The problem, in plain terms

1. **SSH access means any command is possible.**
2. **Commands built from parameters can be injected.**
3. **"Allowed" is implicit**: nobody wrote down what's off-limits.
4. **The requester approves their own changes**, or nobody approves at all.
5. **"Exit code 0" is treated as success**, without checking.
6. **Destructive actions are just another command.**

## 1. The command lives on your server

You **declare an operation on the agent, by name**: `TR_OP_RESTART_NGINX="cmd:sudo systemctl restart nginx"`. **The agent tells us the name and nothing else.** When an operation runs, **we send that name back**. **There are no parameters, so there's nothing to inject**: the most an approved request can do is **exactly what you wrote on your own machine**.

## 2. An admin allowlists it

**Declared isn't enough.** An infrastructure admin **allowlists the name for that server** as **Level 2 (routine)** or **Level 3 (significant)**, with **a timeout**, **the read-only check that verifies it** and, optionally, **a rollback**.

**Names that read as destructive (delete, drop, terminate, wipe, format, disable the firewall) are refused.** **Level 4 has no permission and no path.**

## 3. A policy engine decides, and shows its work

**Every request**, whether it comes from a person, from the AI DevOps engineer during an investigation or from a runbook, is evaluated against the same rules:

- emergency stop;
- tenant;
- server;
- agent connected;
- the requester's permission;
- not destructive;
- allowlisted;
- enabled;
- declared on the agent;
- a rate limit per server;
- no identical request already waiting.

**Each rule's result is stored on the request. One failure blocks it.**

## 4. A named person approves, not the requester

**Production servers need someone with "Approve production operations"**; other environments need **"Approve non-production operations"**. **Requesters can't approve their own requests**, **unapproved requests expire**, and **the policy runs again at the moment of approval**.

## What "succeeded" means

**Succeeded means your agent returned exit code 0 in time.** Then **the verification check runs**, and the operation is marked **verified** or **verification failed**. **A failed verification requests the rollback, for approval, not automatically.** **If no result comes back, the operation is "timed out — outcome unknown", never a success.**

**An emergency stop pauses everything at once.**

## Runbooks without a shell

Runbooks string together **read-only checks, allowlisted operations and waits**, with **preconditions**, **a trigger** (by hand, an alert, a new incident), **a rollback** and **the expected result**. **The AI can draft one from a sentence, using only what the catalogue and the allowlist already allow.** **Someone other than the author approves it**, and **a run that changes anything waits for a named approver before its first step**.

## A worked example, start to finish

Here's the same Sunday at 04:20, with approved operations.

**Last month.** The platform team declared four operations on the database server's agent:

- `TR_OP_RESTART_PGBOUNCER="cmd:sudo systemctl restart pgbouncer"`
- `TR_OP_VACUUM_LOGS="cmd:sudo /opt/scripts/rotate-app-logs.sh"`
- `TR_OP_RELOAD_POSTGRES="cmd:sudo systemctl reload postgresql"`
- `TR_OP_EXPAND_DISK="cmd:sudo /opt/scripts/grow-data-volume.sh"`

An infrastructure admin allowlisted three of them under **Operations → Allowlist**: `VACUUM_LOGS` and `RESTART_PGBOUNCER` at **Level 2**, `EXPAND_DISK` at **Level 3**, each with a timeout and a verification check (*disk usage below 85%*, *service status shows "active (running)"*). `RELOAD_POSTGRES` was declared but not allowlisted. A request to allowlist a script named `delete-old-wal` had been **refused**: the name reads as destructive.

**04:20.** Disk usage on the database server hits 95%. An alert fires and an incident opens.

**04:21.** The **AI DevOps engineer** investigates. It runs read-only checks: disk usage by directory, the application log folder at 31 GB, WAL size normal. It writes facts, hypotheses and a probable cause: *application logs not rotated since a config change on Thursday* (hypothesis, with evidence).

**04:22.** It **requests** `VACUUM_LOGS`, with the reason. The **policy engine** evaluates it: emergency stop off, tenant correct, server correct, agent connected, the AI's permission allows requesting, not destructive, allowlisted, enabled, declared on the agent, under the rate limit, no identical request waiting. **All pass**, and each result is stored on the request.

**04:22.** The server is production, so it needs someone with **Approve production operations**. The on-call engineer, Kwame, is paged.

**04:30.** Kwame reads the investigation and the request on his phone. He approves it. **The policy runs again**: still all pass.

**04:31.** On its next round, the agent runs `/opt/scripts/rotate-app-logs.sh`. Exit code **0** in 40 seconds: **succeeded**. The verification check runs: disk usage **71%**. **Verified.**

**04:35.** Kwame resolves the incident, records the root cause (*logrotate config overwritten by Thursday's deploy*) and goes back to sleep. The WAL files were never touched, because there was no operation that could touch them.

**Monday.** The team uses the AI to **draft a runbook** from a sentence: *"When disk usage on database servers is over 90%, check the largest directories, rotate app logs, and if still over 85%, expand the disk."* The draft uses only `disk usage` checks and the allowlisted `VACUUM_LOGS` and `EXPAND_DISK`. The SRE lead, who didn't draft it, approves it. When it runs, it will wait for a named approver before its first change.

## Five more real-world scenarios

### 1. An operation that's declared but not allowlisted

**Situation.** Someone requests `RELOAD_POSTGRES`.

**How TR handles it.** The policy engine blocks it: not allowlisted. It never runs.

### 2. Approving your own request

**Situation.** An engineer requests a restart and tries to approve it.

**How TR handles it.** Requesters can't approve their own requests.

### 3. No result comes back

**Situation.** The agent loses its connection mid-operation.

**How TR handles it.** The operation is "timed out — outcome unknown", never a success.

### 4. A failed verification

**Situation.** After a restart, the service isn't "active (running)".

**How TR handles it.** It's marked verification failed, and the rollback is requested for approval.

### 5. Something is going wrong everywhere

**Situation.** An incident commander wants to stop all automation immediately.

**How TR handles it.** The emergency stop pauses everything at once.

## Before and after

**Before.** An AI with SSH, a "reasonable" command, deleted write-ahead logs and an outage at 04:20.

**After.** Only named operations you wrote on your own server, allowlisted by an admin, checked by a policy engine that shows its work, approved by a named person who isn't the requester, verified afterwards, and no destructive operations at all.

## How to tell it's working

- **Every operation request shows its policy results.**
- **Every production operation has a named approver** who isn't the requester.
- **Operations are verified**, not just "succeeded".
- **Runbooks only use allowlisted operations.**

## Who it's for

- **SREs and platform engineers** who want automation without the risk.
- **Engineering managers and CTOs** accountable for production.
- **Security and compliance teams** who need to know exactly what can run.

## How it fits with the rest of TicketResolve

This was phase 3 of **DevOps & SRE Intelligence**, after monitoring, read-only checks and incident investigation. Fleet operations, patching, drift fixes and maintenance windows all build on the same declared, allowlisted, approved operations. **Two-person approval in production** and **server access fences** came later.

## Mistakes to avoid

- **Declaring broad commands.** "Run any script" defeats the point; declare specific ones.
- **Skipping verification checks.** Without one, "succeeded" is all you know.
- **Allowlisting at Level 2 what should be Level 3.** Significant changes deserve the higher level.

## Do it in TicketResolve, step by step

**Where:** DevOps & SRE → Operations (`/dashboard/devops/operations`). **You'll need:** the agent on your servers, an infrastructure admin for the allowlist, and approvers with production or non-production approval rights. **Full guide:** [Running an approved operation](https://www.ticketresolve.ai/docs/guide/devops-operations).

1. **Declare it on the server.** Add `TR_OP_RESTART_NGINX="cmd:sudo systemctl restart nginx"` to the agent's environment and restart the agent. Only the name reaches TR-AI.
2. **Allowlist it.** **Operations → Allowlist**: choose the server and the declared name, the level, how to verify it (for example *service status must show "active (running)"*) and an optional rollback.
3. **Request it.** **Request an operation**, with the reason. The policy decision is recorded on the request; a blocked request never runs.
4. **Approve it.** Someone else with the approval permission for that environment approves it. The agent runs it on its next round.
5. **Check the result.** Succeeded means exit code 0; verified means the check confirmed it. If verification fails, the rollback is requested for approval.
6. **Build runbooks.** Draft one from a sentence or by hand, using only allowlisted operations and read-only checks; someone other than the author approves it.

**How to check it worked:** your first operation shows every policy rule passed, a different approver from the requester, and verified after it ran.

## Frequently asked questions

**Does TicketResolve send commands to the server?**
No. It sends the operation's name; the command is written on your server.

**Can parameters be added to an operation?**
No. There are no parameters, so there's nothing to inject.

**What are the levels?**
Level 2 is routine, Level 3 is significant. Level 4, destructive, has no permission and no path.

**Can a destructive operation be allowlisted?**
No. Names that read as destructive are refused.

**What does the policy engine check?**
Emergency stop, tenant, server, agent connection, permission, not destructive, allowlisted, enabled, declared, rate limit and duplicates.

**Who approves production operations?**
Someone with Approve production operations who isn't the requester.

**What does "succeeded" mean?**
Exit code 0 in time. "Verified" means the check confirmed it worked.

**Can a runbook run changes without approval?**
No. A run that changes anything waits for a named approver before its first step.
