Fran Marcano
Agent layer, back to the systems

Triage agent · Architecture

The prompt carries the judgment. The limits live in code.

The same errors kept reaching the team chat, and the first answer depended on who was watching. Now a triage agent answers in the thread with the relevant telemetry already read, and its infrastructure tools can't reach production.

Access
Company SSO · RBAC per action
Memory
Per thread · RAG over company docs
Context
Traces, logs, crash reports
Contents

Context

From an assistant to a triage agent

I started with an assistant. The first version created test data and answered questions about releases. It was organized around what the agent could do, not around what engineers kept asking. The team's real support threads showed what it was missing. Many questions were errors someone had already diagnosed, and many needed live service state the assistant couldn't read.

So I rebuilt it as a triage agent with read access to traces, logs and infrastructure state, and turned the recurring errors into a playbook of known errors. Test data and release checks stayed, as tools. The price is a narrower agent. A new error starts from telemetry and the docs, with no known answer to lean on.

Today it is the triage and SRE subagent of the general agent that engineers reach from the team chat, which runs on AWS Bedrock AgentCore with the Strands Agents SDK. Each channel sets a mode, the general agent delegates triage work to this subagent, and its answer reaches the thread through the chat gateway. It triages support requests and crash alerts, supports SRE work during an incident by reading live state, creates test data and checks releases, within what each person's role allows. The platform it shares with the other subagents (the chat gateway, the harness, company SSO with a role check on every action, memory and evals) is described in the platform article.

The model's work here is judgment: reading a crash next to the code that threw it, a trace next to the log line that explains it, or a vague question next to an error the team has seen before.

Architecture

What it reads

  • Telemetry. OpenTelemetry traces in OpenSearch, CloudWatch logs and crash reports.
  • Code and docs. The code behind a stack trace, through the code host, and the team's documentation.
  • The playbook. Errors the team has already diagnosed, written from past support threads.
  • Live state. Release status, test data and infrastructure state, and a people directory among other tools.

The general agent hands triage to its subagent

From the team chat to the triage subagent and back

Fig. 1: the path of every triage request, and the one place where triage reasoning happens. People and alert bots post in the team chat: a mention, a direct message or a crash alert. The chat gateway, which holds no model, maps the channel to a mode, filters alert kinds, and handles the streaming and the cards; it sends the general agent the prompt, mode, asker and thread. The general agent delegates by task: triage goes to the triage subagent, other work to other subagents. Inside the triage subagent, which never posts to the chat, the model loop is where triage reasoning happens. It calls tools by name with typed input and gets a result or a refusal back; the tools are crash reports, code host, traces and logs, release status, test data, infrastructure state and docs, and the infrastructure tool stops at a barrier: production refused. The subagent reads known errors and the thread context from memory, which also retrieves from the docs (RAG). The subagent returns events (text, tool calls, summary, end) to the gateway, which streams the answer into the team chat and posts the card. Team chat people, alert bots Chat gateway NO MODEL channel → modealert kindsstreamingcards General agent delegates by task other subagents Triage subagent NEVER POSTS TO CHAT Tools Model loop crash reports code host traces · logs release status test data infrastructure state docs Memory and known errors known errorsRAG over docsthread context mention, direct message, crash alert prompt, mode, asker, thread delegates call by name, typed input result or refusal known errors, thread context RAG production refused events: text, tool calls, summary, end streams the answer, posts the card Fig. 1: the path of every triage request, top to bottom, and the one place where triage reasoning happens. The team chat, people and alert bots, sends the chat gateway a mention, a direct message or a crash alert. The chat gateway holds no model: channel to mode, alert kinds, streaming, cards. It sends the general agent the prompt, mode, asker and thread, and gets back events from the triage subagent: text, tool calls, summary, end; then it streams the answer into the team chat and posts the card. The general agent delegates by task: triage to the triage subagent, other work to other subagents. In the triage subagent, which never posts to the chat, the model loop is where triage reasoning happens. It calls tools by name with typed input and gets a result or a refusal: crash reports, code host, traces and logs, release status, infrastructure state (production refused), docs and test data. The subagent reads known errors and the thread context from memory, which also retrieves from the docs (RAG). Team chat people, alert bots Chat gateway NO MODEL channel → mode · alert kinds streaming · cards other subagents General agent delegates by task Triage subagent NEVER POSTS TO CHAT Model loop Tools crash reports code host traces · logs release status infrastructure state docs test data Memory and known errors known errors RAG over docs · thread context mention, direct message, crash alert streams the answer, posts the card prompt, mode, asker, thread events: text, tool calls, summary, end delegates call by name, typed input result or refusal production refused RAG known errors, thread context
Fig. 1The channel sets the mode, the general agent delegates, and everything the subagent says reaches the chat through the gateway, which never calls a model.

Lifecycle

Three kinds of request

A crash alert is a request nobody typed. The crash reporter posts an alert in an alerts channel. The gateway reads its type and drops the kinds the agent doesn't triage. The rest go to the general agent as a triage prompt in that channel's mode, and the triage subagent reads the crash through the crash-report tools and the code behind it through the code-host tools. It returns a summary with a severity and the code's likely author, and the gateway turns that into a triage card in the alert's thread, with buttons for feedback.

A support question is the case it was rebuilt for. The agent reads the traces and logs around the request and matches what it finds against the playbook. When no known error fits, the docs and live service state carry the answer. It answers in the thread, and the engineer decides what to change.

A request from a person takes the same path. An engineer mentions the agent and asks for a test user. The gateway passes along the prompt, the channel's mode, who is asking and the thread. The agent picks the test-data tool, and the action runs only if the engineer's role allows it. Asking for another test user in the same thread keeps the first request's context.

Not every alert reaches the model

One crash alert, from post to card

Fig. 2: one crash alert, in four steps, across the team chat, the chat gateway, the general agent and its triage subagent, and the tools. 1. A bot posts a crash alert in an alerts channel of the team chat. 2. The chat gateway reads the alert type and asks whether it is a kind it triages. If not, nothing happens, and that is a valid end. If it is, the gateway sends the general agent a triage prompt in the channel's mode, and the general agent delegates to the triage subagent. 3. The triage subagent reads crash reports and the code host through the tools, and returns a summary to the gateway: a severity and the likely author. 4. The gateway posts a triage card in the alert's thread, with feedback buttons. Team chat Chat gateway General agent →triage subagent Tools 1 bot crash alert in an alerts channel 2 read alert type a kind it triages? no nothing (valid end) yes triage prompt, channel mode delegates 3 crash reports, code host summary: severity, likely author 4 triage card in the alert's thread, feedback buttons Fig. 2: one crash alert, in four steps. 1. Bot to team chat: a crash alert in an alerts channel. 2. Team chat to chat gateway: read the alert type. Is it a kind the gateway triages? No: nothing, a valid end. Yes: the chat gateway sends the general agent a triage prompt in the channel's mode, and the general agent delegates to the triage subagent. 3. Triage subagent and tools: crash reports, code host. Triage subagent to chat gateway: a summary with the severity and the likely author. 4. Chat gateway to team chat: a triage card in the alert's thread, with feedback buttons. 1 Bot → Team chat crash alert in an alerts channel 2 Team chat → Chat gateway read alert type a kind it triages? no nothing (valid end) yes Chat gateway → General agent triage prompt, channel mode General agent → Triage subagent delegates 3 Triage subagent ↔ Tools crash reports, code host Triage subagent → Chat gateway summary: severity, likely author 4 Chat gateway → Team chat triage card in the alert's thread, feedback buttons
Fig. 2Code decides which alerts reach the model. What comes back is a triage card in the alert's thread.

Controls

Where the limits live

The agent has three limits: no infrastructure tool changes anything, none reaches production, and no action goes beyond what the engineer's role allows.

The easiest place to write a limit is the prompt, and a limit there holds only while the model follows it. A system prompt is text the model weighs against other text, such as the engineer's message, a log line or a stack trace pasted into the thread. A check in a tool's code runs the same way whatever that text says.

Each channel has a mode, and the mode only picks the system prompt. General questions get one, support and release channels another. Connecting a channel takes one entry in the gateway's table and a deploy. The tool list stays the same in every mode, and a request with no mode gets the general prompt. That fallback is safe because no default can widen what the agent may do.

One tool surface means one surface to review, and no channel can get a smaller tool list, so a narrower limit has to be written as code, inside the tool or in the services around the model. The infrastructure tools are where that matters most. They read live service and deployment state outside production, which is what an incident needs, and they check the target environment in their own code and refuse production. The agent's docs say it in one line: don't move this check into the prompt.

Each tool's docstring is the spec the model reads, so a change to what the model is told shows up in the same diff as the code. The evals that decide whether a change to the prompt, a tool or the playbook stays are built from real support threads and past alerts.

Where each limit lives

The prompt on top, the limits in code

Fig. 3: the layers a request passes through, and what each one holds. A request drops through four layers. The prompt, per mode, holds judgment for the channel's kind of work. The chat gateway's code maps the channel to a mode and holds the alert kinds it triages. The agent platform rejects an unknown mode, delegates to the triage subagent, and a tool exists there only as code, with its docstring and tests. The infrastructure tools are read-only, and production is refused in the tool's own code: an arrow aimed at production stops at a barrier. Beside the stack, outside it, access: company SSO and a role check per action, alongside the tool calls. Prompt, per mode judgment for the channel's kind of work Chat gateway code channel → mode alert kinds it triages Agent platform unknown mode rejected delegation to the triage subagent a tool exists only as code, with its docstring and tests Infrastructure tools read-only production refused in the tool's own code Access company SSO role check per action production request Fig. 3: the layers a request passes through, top to bottom, and access beneath them. A request drops through four layers. Prompt, per mode: judgment for the channel's kind of work. Chat gateway code: channel to mode, alert kinds it triages. Agent platform: unknown mode rejected; delegation to the triage subagent; a tool exists only as code, with its docstring and tests. Infrastructure tools: read-only, production refused in the tool's own code; an arrow aimed at production stops at a barrier. Under the stack, outside it: access, company SSO and a role check per action. Prompt, per mode judgment for the channel's kind of work Chat gateway code channel → mode alert kinds it triages Agent platform unknown mode rejected delegation to the triage subagent a tool exists only as code, with its docstring and tests Infrastructure tools read-only production refused in the tool's own code production Access company SSO · role check per action request
Fig. 3Take the prompt layer away and every limit in this figure still holds.

Decisions

It doesn't fix what it finds

That is the largest cost of the design. In an incident, a person makes the change, and that can cost minutes an agent with write access might have saved. In exchange, its infrastructure tools only read, so a message in a thread, typed or pasted from a log, can't make them change anything.

I left out the tools that fix things, such as restarting a service or changing a setting. Each one would put a write path next to production, and each such path is one more limit that has to be right in code.

The playbook only knows errors that have already happened, so it is only as current as the threads it was written from.

Results

In production

The triage agent runs in production, on support requests and crash alerts, and the engineer still takes it from there.

To build one, a team needs to triage in a chat already, have telemetry an agent can read, such as traces, logs and crash reports, and have enough past threads to write a playbook and evals from. It also needs typed tools it can test without the chat, an identity provider and roles to check each action against, and infrastructure it can read without write access. It helps less when the bottleneck is the fix rather than the diagnosis, or when the systems record too little for an agent to read.

If I started again, I would read the threads before choosing the tools. I did it the other way round, and rebuilt the agent. I would also write the limits before the prompt and test them. If deleting a sentence from the prompt would open production, the limit is in the wrong place.

Next system

What turns a model into an agent?

The harness around it: tools, memory, runtime and guardrails. I build that layer, including what the agent is not allowed to do.

Agent layer

Contact

What should your team stop doing by hand?

LinkedIn