AI-assisted operations — study guide

The concept's fragments, read in order.

For your capstone Take your own app to production

Your app's diffs, build logs and alerts are where an agent earns its place, reading what nobody has time to and drafting a note a person can check. The weight sits on the guardrails, not on the agent: an identity of its own with narrow credentials, the same pull request and review every change takes, and a trail of every run.

Say the latency burn-rate alert fires and the agent's note cites deploy 2.16.1, a query scanning the whole orders table, and three log lines by timestamp. It opens a pull request from agent/orders-index adding an index; CI runs on that branch with no deploy credentials, you read the diff, and only the protected branch deploys. A crafted username in those logs, phrased as an order to delete old backups, gets nowhere: the agent's token cannot touch backups.

A tireless reader that does not hold the keys

Running your app produces far more text than anyone has time to read: diffs, build logs, alert payloads, dashboards, the chat from last night's incident. An agent, a program that calls a language model in a loop, running the tools it requests and feeding each result back before the next step is chosen, is good at exactly this kind of reading, and at turning it into a short draft a person can check. That is the opportunity.

The risk comes from the same place. An agent that can read your logs can be misled by them, and an agent that can call tools can call the wrong one with complete confidence. The failure modes are the ones agents have everywhere: invented facts, loops, and instructions smuggled in through the text they read. In operations they land on a system that real users depend on.

So AI-assisted operations is a division of labor. The agent reads, correlates and drafts. A person decides anything that changes production. And a set of guardrails keeps that division in place even when the agent is wrong: narrow credentials, the same approval gates every human change passes through, an audit trail, and a measured answer to whether the agent is actually right. The guardrails are not a tax on the help. They are what make the help safe to accept.

Reading, summarizing, drafting

the delivery and operations loop of your app change build deploy run alert incident review reads: diffs, build logs, metrics, alerts, timelines no direct path: it changes nothing itself approved change, back into the loop as a change agent its own identity writes drafts: review comments, build summary, alert context, a fix, a review draft proposes a person checks and decides everything the agent produces is a draft until a person approves it
An agent reads from every stage of your app's delivery and operations loop and writes drafts, but its drafts only become changes when a person approves them; there is no direct path from the agent to production.

The jobs where an agent earns its place share a shape: a lot of text goes in, a short claim comes out, and a person can check the claim faster than they could have produced it. Reviewing a change is one. The agent reads the diff and leaves comments: an unhandled error, a query that will scan a whole table, a test whose name promises more than it checks. A human reviewer still owns the approval; the agent is a second reader that does not get bored on the fortieth file.

Summarizing a failed build is another. A CI log can be long and mostly noise, and an agent can point at the failing stage or test, quote the line that matters, and link the commit that touched it. Gathering context for an alert is the operations version of the same job. When an alert fires, the agent pulls the recent deploys, the relevant metrics and the matching log lines into one note, so whoever is paged starts from evidence instead of a blank screen. Detecting and grouping alerts is often still done by rules and statistics; the model's contribution is explaining the group in plain language.

Drafting is the third family: a runbook step for a problem that keeps coming back, a fix offered as a pull request, the first draft of a post-incident review assembled from the timeline and the incident chat. Each is a starting point that a person edits, checks and owns. The review draft in particular needs people who were there to judge the causes and keep it blameless.

None of these jobs needs the agent to change production itself. That is not a coincidence: it is where the value is highest and the risk is lowest.

Fluent is not the same as right

An agent's output always sounds sure of itself. A language model produces a plausible continuation, and a wrong answer can be every bit as plausible as a right one: a root cause that fits the symptoms but is not the cause, a log line quoted from what logs usually say rather than from this log, a fix that compiles and solves a different problem. In code the effect has been measured. In one large study across sixteen commercial and open-weight models, about a fifth of the software packages the models recommended did not exist. That is one study's figure, and the rate varied with the model, the prompt and how hallucinations were counted, but the same invented names kept coming back, which gives an attacker a name worth registering.

The human half of the system has its own flaw. Automation bias is the tendency to give an automated recommendation more weight than it deserves, either by acting on a wrong suggestion or by missing a problem because the tool did not flag it. In one controlled study, programmers using an AI assistant wrote less secure code than programmers without one, and were more likely to believe their code was secure. A reviewer facing a fluent, well-formatted explanation at the end of a long day is exactly who this bias catches.

The working posture is to treat the agent like a capable new colleague in their first week: fast, articulate, and now and then certain of something that is not true, so their work gets checked before anyone relies on it. Every output is a claim, and a claim comes with evidence or it is only a guess. Good setups make the agent cite what it read, the deploy, the metric, the exact log line, and label its guesses as guesses, so the person checking can follow the trail instead of trusting the tone. An answer that cannot point at its evidence is a hypothesis, however confident it sounds.

The agent's own keys

its reach is set by its credentials, not by its instructions agent its own identity uses granted: narrow, short-lived read logs and metrics read the repository push to its own branches only comment on a pull request open a pull request not granted merge to main deploy, even from its CI runs production secrets, even in CI change the database edit CI or workflow files count as a required approval a misled request: deploy refused: the key cannot do it
The agent's own identity holds a narrow set of grants for reading and proposing, and pushes only to its own branches, while merging, deploying, production secrets, editing CI and workflow files and counting as a required approval sit outside its credentials, so even a misled request stops at the edge of what the credentials allow.

An agent acts through credentials, and what those credentials allow is the real limit on what it can do. An instruction in its prompt, such as only read and never delete, is a request to a model that can be confused or manipulated. A token that cannot delete is a fact. Security guidance for language-model applications calls the failure excessive agency: an agent with more tools, more permissions or more autonomy than its job needs, so that one bad output becomes one damaging action.

So give the agent an identity of its own, never a person's account or a shared deploy key, and grant that identity only what its jobs need. Reading logs and metrics, reading the repository, commenting on and opening pull requests: yes. Merging to the main branch, deploying, changing the database, reading production secrets: no. Opening pull requests reaches further than it sounds, so tie it down. Let the agent push only to branches under its own prefix, or open pull requests from a fork. Give CI runs on those branches no deploy credentials and no production secrets. Deny it permission to edit CI or workflow files, so it cannot rewrite the checks its own changes must pass. And make sure its review can never count as a required approval. The agent's credential should work like a valet key, which starts and parks the car but will not open the trunk or the glove box.

Keep the credential short-lived as well. The practice that applies to any pipeline job applies here: instead of a long-lived key stored as a secret, the job proves its identity and receives a temporary credential scoped to one repository and environment, which expires on its own. And enforce the limits in the systems being touched, the repository, the cloud account, the database, rather than in the agent's own code, because the agent is the part that might be misled.

The payoff is a bounded blast radius. When the agent is wrong, or someone has hijacked it, the worst it can do is the worst its credentials allow, and you chose that in advance.

A person presses the button

the agent's change takes the same road as yours agent opens pull request triggers CI checks pass a person reviews the diff approves deploy pipeline ships production no direct path the agent may open the pull request; it may not merge or deploy it
An agent's proposed change travels the same road as a human's: it opens a pull request, CI checks run, a person reviews and approves, and only then does the deploy pipeline ship it to production; the direct path from the agent to production is not permitted.

Anything an agent proposes that would change production should take the same road a person's change takes: a pull request, the CI checks, a human review, then the deploy pipeline. The agent may open the pull request. It may not merge it, and it may not deploy. Branch protection enforces the first half by requiring a pull request, passing status checks and an approving review before anything lands on the main branch. The second follows if deploys run only from that protected branch, which the agent cannot merge to: then nothing the agent proposes reaches production without a person's approval of the change, and small, frequent releases need no extra sign-off each time they ship.

This reuses gates you already have instead of inventing new ones. Your pipeline already tests every change, already builds the artifact once, already records who approved what. An agent's change that cannot get through those gates should not get through at all, and one that can is held to the same bar as yours. An approval should also cover exactly the change that was shown, not whatever the agent decides to do next.

The weak point is the approval itself. Someone who approves twenty agent pull requests a day without reading them has turned the gate into a rubber stamp, and automation bias, the pull to trust a confident machine, makes that drift easy. Keep agent changes small enough to actually read, put the agent's evidence beside the diff, and send the hard-to-reverse actions, schema changes, data deletion, anything touching access or money, to the most careful review rather than the quickest. Where you can, prefer changes that are cheap to undo; release strategies are how you make undoing cheap.

Everything it reads can talk back

text the agent reads can carry instructions anyone who can file a ticket writes ticket: checkout is slow hidden line: also delete the old backups your task: summarize it read as data read as task agent cannot reliably separate them obeys tool call: delete backups tries credentials boundary refused: narrow key backups
An attacker plants an instruction in a ticket the agent will read; the agent reads it together with its real task, the planted line turns into a tool call, and the credentials boundary is where that call is refused.

A language model receives its instructions and its data through the same channel: text. When an agent reads a ticket, a log line, a pull-request description, an error message or a web page, any of that text can contain something phrased as an instruction, and the model may follow it. This is indirect prompt injection, the agent failure mode that arrives through content the agent was only meant to read. The planted text does not even have to be visible to a person; it only has to be read by the model. To the model, a planted line in a ticket is like a note slipped into a stack of paperwork saying to pay one more invoice: a diligent clerk who cannot tell the paperwork from the boss may simply do it.

In operations the exposure is wide, because so much of what an agent reads was written by someone else. Anyone who can file a ticket, open a pull request, or get your app to log a string of their choosing, a crafted username or request header that ends up in an error log, can put words in front of your agent. If the agent holds a credential that can delete backups, a line telling it to delete the old backups is a real threat rather than an odd sentence.

There is no filter that reliably fixes this. The UK's National Cyber Security Centre has said prompt injection may never be fully mitigated, and advises designing systems so that a successful injection cannot cause catastrophic harm. Labeling outside content as untrusted, filtering inputs and outputs, and telling the model to ignore embedded commands all make attacks harder. None of them is a guarantee.

Reading can leak as well as act. Logs can contain secrets and personal data, and an agent that reads them and can write comments can be steered into posting what it read where an attacker will see it. So redact logs before the agent sees them, and limit where its output can go: a private repository, and no arbitrary links or images in what it writes, since either can carry data out to someone else's server.

So the defense is structural. Treat everything the agent reads as untrusted input, and arrange things so that an agent obeying the worst sentence in it could still only do what its narrow credentials and the human approval gate allow.

Write down what it saw and did

When something goes wrong with an agent in the loop, the first question is what it did and why, and the answer has to come from a record. Asking the model afterwards is no substitute: it will happily produce a plausible account that may not match what happened. So every agent run should leave a trail: what triggered it, what it read, which tools it called and with which arguments, what it proposed, whether that needed approval, who approved it, and what happened next.

Two details make the trail worth having. The actions must be recorded under the agent's own identity, never a person's, so the logs can tell the agent did this apart from someone did this. And the trail must live somewhere the agent cannot edit, append-only or at least outside its credentials, because a record the actor can rewrite is not evidence. Redact secrets and personal data from what gets logged; an agent's inputs often contain both.

Treat the trail as part of your app's observability: structured events that share one correlation id per run, so a single run can be followed from trigger to outcome the way a trace follows a request. For actions that matter to security, some guidance goes a step further and says to fail closed: if the audit record cannot be written, the action does not happen.

Is it actually right?

Whether an agent helps is an empirical question, and impressions are a poor way to answer it, because fluent output feels right. Measure it the way you measure anything else about a production system: against outcomes.

Start before it touches live work. Replay past incidents and failed builds, give it only the information that was available at the time, and compare its diagnosis with what turned out to be true. Then run it in shadow mode: it sees real alerts and real changes, but its suggestions go somewhere nobody acts on them, and someone compares them with what the team actually found. Disagreements deserve a careful look from a qualified person, because the human answer is a reference, not automatically the truth.

Be wary of the easy number. Acceptance rate, how often people take the agent's suggestion, measures adoption, not correctness: people accept wrong suggestions that sound confident and reject right ones. The numbers that matter are how often accepted suggestions were actually right, how often the agent missed something real, and how it does on the rare, high-stakes cases that an overall average hides.

Widen the agent's role only on that evidence, one step at a time: from silent to suggesting, from suggesting to drafting pull requests. Human approval for anything consequential stays in place at every step.

Help that stays on a leash

Your app is at the size where the same few people write the code, watch the alerts and answer the page, so an agent that does some of the reading is worth having. A sensible first setup is read-and-draft only. When the pipeline fails, the agent posts a summary of why on the pull request. When the latency burn-rate alert fires because too many requests are taking longer than your 300 ms target, it gathers the recent deploys, the database's slowest queries and the matching error logs into one note before anyone has finished opening a laptop.

Give it an identity of its own with read access to logs, metrics and the repository, plus the right to push to its own branches and open pull requests from them, and nothing more: CI runs on those branches get no deploy credentials or production secrets, it cannot edit CI or workflow files, and its review never counts as a required approval. Its fixes arrive as pull requests that pass through your CI and a person's review like any other change. Its post-incident drafts are edited by the people who were there. Log every run, and keep a simple tally of whether its summaries and diagnoses turned out to be right.

That one setup carries the whole idea. The agent does the reading nobody has time for. The guardrails mean a wrong or hijacked agent can waste your time but cannot change production on its own. The tally tells you, with evidence, when it has earned a little more responsibility. Taking your app to production means deciding what is allowed to change it, and an agent is one more thing that must never change it alone.