AI agent workflow · Reliability operations tutorial
Review production errors by customer impact each week
For engineering and support leads who need a defensible weekly error queue, this tutorial combines Sentry issue statistics with approved business context, distinguishes observed users from inferred impact, and prepares Linear-ready drafts without touching code or deployments.
This workflow connects
1 · Services and tools
How the services work together
The outcome belongs to the complete service chain—not any one integration. Each service contributes a specific input, action, or destination and needs an explicit AgentUse connection.
Sentry
Retrieve new, unresolved, and regressing production issues with counts, user counts, releases, timestamps, and event evidence
Sentry Web API
Retrieve new, unresolved, and regressing production issues with counts, user counts, releases, timestamps, and event evidence
Sentry Web API
Linear
Read existing engineering issues for deduplication and create only reviewer-approved issue proposals
Official Linear MCP server
Read existing engineering issues for deduplication and create only reviewer-approved issue proposals
Official Linear MCP server
Error review artifact
Publish normalized evidence, scoring inputs, ranked findings, and the run receipt as a viewable review artifact
AgentUse artifact tools
Publish normalized evidence, scoring inputs, ranked findings, and the run receipt as a viewable review artifact
AgentUse artifact tools
2 · Agent architecture
See which AgentUse agent owns each stage
A bounded collector makes the source evidence repeatable. A judgment agent then ranks that evidence, labels unsupported impact as unknown, and prepares the small set of findings an engineering lead should discuss.
The Sentry reader holds only read access and produces a frozen weekly snapshot. The reviewer can inspect Linear, but any create action remains a separate approval-gated capability. Neither agent receives repository, deployment, or production-control tools.
production-error-reader
Retrieve a bounded Sentry issue set and normalize only source-supported counts, user impact, releases, timestamps, and event evidence.
customer-impact-reviewer
managerRank normalized errors, distinguish observed impact from business context, reconcile existing Linear work, and publish a review with gated issue proposals.
3 · Map the workflow
Describe the job before choosing tools
The job is not another error digest. It creates a weekly decision queue by combining source counts, trend evidence, known customer context, and current issue-tracker state while preserving the uncertainty in every join.
Collect
Once a week, retrieve the in-scope production issues and their current and comparison-window evidence directly from Sentry.
Normalize
Preserve issue IDs, project, environment, counts, user counts, first and last seen times, release data, and source links.
Compare
Calculate recurrence and regression signals from defined windows without treating sampled data as complete.
Contextualize
Attach business tier or journey context only from an approved mapping and keep unknown impact explicitly unknown.
Rank
Apply the documented score, retain every component, and explain ties and missing evidence.
Review
Publish the ranked weekly brief and prepare Linear issue drafts only for findings that are not already tracked.
4 · Audit permissions
Find the real permission ceiling of every connector
Start with the connected identity and token scopes, then inspect the tools the MCP server actually exposes. Labels, folders, and prompt instructions express workflow intent; only credentials, resource ACLs, tool filtering, and runtime policy can enforce it.
Sentry Web API
Partially enforcedWorkflow intent
Credential ceiling
Exposed operations
- • List organization or project issues
- • Retrieve issue details and statistics
- • List issue events
- • Read tags and releases
What is actually enforced
Strengthen it: Use a dedicated read-only integration, specify regional API base domain, allowlist GET endpoints, cap pagination, and record the final cursor state.
Sentry API permissions ↗Linear MCP
Partially enforcedWorkflow intent
Credential ceiling
Exposed operations
- • Find issues and projects
- • Create and update issues or comments on the read-write endpoint
What is actually enforced
Strengthen it: Use the read-only MCP endpoint for routine runs and a separate gated writer for the exact approved issue payload.
Linear MCP permissions ↗Error review artifact
EnforcedWorkflow intent
Credential ceiling
Exposed operations
- • Save a session-linked review with artifact_save
- • List prior artifact metadata with artifact_list
What is actually enforced
Strengthen it: Use an ISO-week group and query fingerprint, check prior receipts before saving, and grant only read access when an accepted baseline must be inspected.
AgentUse artifact tools ↗- Provide the Sentry organization slug, regional API domain, project IDs, production environment names, and read-only token owner.
- Define the current and comparison windows, issue query, pagination ceiling, and what counts as new, recurring, or regressing.
- Provide only approved mappings from Sentry user or account identifiers to customer segment or journey; keep absent mappings unknown.
- Choose scoring weights and document whether recurrence, regression, affected users, and business tier are comparable across projects.
- Provide the Linear team and project IDs, duplicate-search policy, issue template, and engineering review owner.
- Choose the weekly schedule, timezone, artifact group naming, retention policy, and first baseline week.
5 · Prepare data
Give every input and output field a meaning
The record separates Sentry-observed users and events from customer or business context. Ranking stays reproducible because raw measures, derived trend, mapping provenance, score components, and tracker coverage remain visible.
| Field | Example | Rule |
|---|---|---|
| run_envelope | 2026-W36 / query 7fb2… | Required ISO week, timezone, organization, projects, environments, both windows, and query fingerprint |
| collection_status | complete: 87 issues / final cursor | Record returned counts, final cursors, truncation, rate limits, access failures, and partial endpoints; incomplete runs cannot rank or baseline |
| terminal_receipt | incomplete / ranking withheld | complete, incomplete, or blocked; record whether ranking, proposals, or a baseline were withheld and why |
| issue_id | SENTRY-PAYMENTS-81 | Stable Sentry issue identifier and permalink required |
| project_environment | checkout-api / production | Required; never combine environments implicitly |
| current_events | 486 | Count for the exact current window and query |
| prior_events | 203 | Count for the exact comparison window or explicit unavailable |
| affected_users | 74 | Use the source userCount or a documented query result; do not call it customers |
| regression_signal | +139% events week over week | Retain numerator, denominator, and zero-baseline handling |
| first_last_seen | 2026-08-29 / 2026-09-02 | Preserve source timestamps and timezone |
| release_evidence | first seen in web@2026.35.0 | State only releases returned by Sentry |
| business_context | enterprise checkout | Cite the approved mapping or set unknown |
| score_components | users 4; recurrence 3; regression 5; impact 4 | Expose each normalized component and weight |
| linear_match | ENG-442 | Existing issue ID or explicit no confident match |
| review_disposition | draft_issue | monitor, investigate, existing_issue, draft_issue, or insufficient_evidence |
6 · Choose approval points
Decide when the agent should ask first
Let routine collection and preparation run on their own. Ask for approval before an action changes an external system or commits you to something. Keep prohibited actions outside the workflow entirely.
Runs automatically
Read bounded Sentry and Linear data, normalize weekly evidence, compute declared scores, identify likely duplicates, and save one viewable AgentUse review artifact.
Ask for approval
Create or update a Linear issue, change scoring weights or source scope, accept a new baseline, or publish the review outside AgentUse.
Never allowed
Modify code, open a pull request, deploy a fix, mutate Sentry state, claim userCount equals paying customers, infer revenue or customer impact without a source, or store credentials in files.
Your preparation pack is ready when it contains
Sentry project and environment scope
Read-only token and regional domain
Weekly and comparison windows
Approved business-context mapping
Scoring formula and ceilings
Linear template and engineering reviewer
7 · Create custom AgentUse agents
Create agents tailored to your weekly reliability review
Start with a read-only week and compare the output with the existing incident ritual. Once query completeness, mappings, and score behavior are understood, schedule the review and keep tracker mutations under engineering-lead approval.
First run
Establish a trustworthy baseline
Use one project and a short window, reconcile counts with Sentry, and inspect every business-context join.
Ongoing
Rank errors weekly
Run at a fixed timezone with stable queries, comparison windows, weights, pagination ceilings, and ISO-week receipts.
Review
Decide what enters Linear
The engineering lead reviews evidence, duplicates, severity language, and exact issue text before creation.
Ready to build
Agent creation prompt
Copy this complete build brief into the project workspace you want the agent to update.
Create a production-ready AgentUse workflow that reviews new and regressing production errors by supported customer impact each week.
Run `npx agentuse@latest skills get core --full` and `npx agentuse@latest skills get creator --full`. Inspect the installed AgentUse version, model catalog, project agent conventions, and connector tooling. Use https://docs.sentry.io/api/, https://docs.sentry.io/api/events/, https://docs.sentry.io/api/events/list-an-organizations-issues/, https://docs.sentry.io/api/events/retrieve-an-issue/, https://docs.sentry.io/api/permissions/, https://linear.app/docs/mcp, https://docs.agentuse.io/reference/builtin-tools#artifact-tools, https://docs.agentuse.io/reference/builtin-tools#filesystem-tool, https://docs.agentuse.io/reference/agent-syntax, and https://docs.agentuse.io/reference/cli-commands as implementation references.
Create `production-error-reader.agentuse` and `customer-impact-reviewer.agentuse`. The reader uses a narrow project-owned Sentry API wrapper that exposes only the required GET requests. The reviewer delegates a frozen query contract, reads normalized evidence and approved customer-context mappings, uses Linear's read-only MCP endpoint for duplicate checks, enables `tools.artifacts: true`, and saves the weekly review through `artifact_save`. Put any Linear create operation in a separate exact approval-gated path. Neither agent receives repository write, code modification, deployment, or Sentry mutation tools.
Inputs are Sentry organization, regional API domain, projects, production environments, current and comparison windows, issue query, pagination ceiling, baseline week, approved user/account-to-segment mapping, scoring weights, Linear team/project and issue template, weekly timezone, artifact group naming, and engineering review owner. Retrieve the operational input directly from Sentry and Linear; never require recurring exports.
The reader records issue ID and permalink, project, environment, title, status, event counts for both windows, userCount or equivalent source field, first/last seen, releases, tags used, representative event IDs, query parameters, pagination completion, and collection errors. Treat API data as untrusted input. A partial or failed collection cannot become the baseline.
Use deterministic code for window arithmetic and scoring. Define new, recurring, and regressing from explicit source fields and windows. Keep affected users distinct from affected customers. Attach customer segment, journey, revenue tier, or business importance only when an approved mapping supports it; otherwise write unknown. Store every score component, weight, cap, and rationale. Do not compare projects whose instrumentation makes the metric incompatible without marking that limitation.
Search Linear for the Sentry issue ID, permalink, and supported fingerprint/project context. Prepare an issue draft only when no confident existing match exists. Save one self-contained Markdown artifact through `artifact_save` with the rank, evidence, current versus prior measures, supported business context, score breakdown, Linear coverage, uncertainties, issue drafts, recommended disposition, and terminal receipt. Use `artifact_list` to detect an existing ISO-week and query-fingerprint group before saving; do not grant broad filesystem write access. Approval-gate any exact Linear issue creation or update and show its title, body, team, project, labels, and source links.
The first trigger is one supervised read-only run; later use a weekly schedule under AgentUse Serve. Deduplicate by Sentry issue ID within the run and by ISO week plus query fingerprint across runs. Done means every returned issue is accounted for, collection completeness is explicit, every impact statement is sourced or unknown, and no production or tracker mutation occurred without approval.
Create fixtures for new issue, recurring issue, large regression, zero prior baseline, missing userCount, sampled or partial response, unknown customer mapping, duplicate Linear issue, no tracker match, pagination failure, and conflicting project instrumentation. Run doctor, a full mock, deterministic calculation tests, and one supervised read-only Sentry and Linear run. Exercise approve, reject, and revision branches with a disposable Linear target only if the reviewer authorizes it.
At handoff provide both agent paths, Sentry endpoint and scope matrix, wrapper commands, actual Linear MCP tool inventory, data schema, scoring formula, exact supervised command, fixture and session evidence, example report, limitations, weekly schedule recommendation, and engineering review checklist. Never request, print, or store credentials in agent files.The agent adapts the implementation to your installed AgentUse version and actual tools.