managing-sre-agent
Skill187 starsChanged 6 months agoMITView on GitHub
Manage Azure SRE Agent configuration for this demo: connectors, skills, guarded custom agents, response plans, and the knowledge base. Use when asked to create, list, update, or delete SRE Agent resources.
In this repository28 other files it gives its agents.
- labs/onboardinglab/AGENTS.mdAGENTS.md
- labs/zava-aks-postgres/AGENTS.mdAGENTS.md
- labs/zava-learning/AGENTS.mdAGENTS.md
- deployment-compliance-checkSkill
- onboarding-labSkill
- azure-monitor-rcaSkill
- email-incident-followupSkill
- github-issue-followupSkill
- proactive-health-checkSkill
- ticketing-pr-validationSkill
- compliance-drift-detectionSkill
- vm-performance-diagnosticsSkill
- deploying-demoSkill
- running-demoSkill
- connectivity-triageSkill
- cost-analysisSkill
- evidence-before-afterSkill
- nsg-auditSkill
- pagerduty-incident-updateSkill
- performance-investigationSkill
- pr-deliverySkill
- rbac-auditSkill
- rca-analysisSkill
- recommendations-next-stepsSkill
- redaction-guardSkill
- servicenow-change-managementSkill
- zava-audit-reportSkill
- zava-reportingSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Do not design overlapping response plans around an assumed priority or specificity rule.
- Very specific: line 45
Only run that command with authorization to modify live configuration.
- Very specific: line 85
Use @@RG@@ placeholder anywhere you need the resource group name
- Distinctive: line 92
Keep global instructions short.
- Very specific: line 111
Default SkillOwned mode declares Monitor dependencies on the evidence skills.
- Very specific: line 116
Run the local contracts with python -B -m unittest discover -s .\tests -p 'test_*.py' -v (Python 3 and PowerShell 7.4+, no packages).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SRE Agent Administration
For this demo, core agent configuration is declared in Bicep
(infra/modules/sre-agent.bicep):
- Agent settings — autonomous mode, High access level, Azure Monitor incident binding
- RBAC — system-assigned managed identity granted Reader, Monitoring Reader, Contributor, and AKS RBAC Cluster Admin on the resource group; the runtime user-assigned identity also has subscription-level Reader so the correlation skill can read Alerts Management and Resource Health event feeds
To change these resources, edit the Bicep and run azd provision.
The four connectors (app-insights, log-analytics, azure-monitor, and
learn-docs) are declared under connectors in sre-config/agent-config.json.
Setup applies them using infra/modules/sre-agent-connectors.bicep after an
authenticated API-readiness gate. Do not put them back in the core agent module:
that would block post-provision recovery while the backend is still starting.
Runtime skills, custom agents, and response plans are defined in
sre-config/agent-config.json. Skill procedures live in sre-config/skills/;
agent definitions live in sre-config/agents/.
scripts/setup-sre-agent.ps1 renders these and embeds the shared
sre-config/hooks/readonly-evidence.py into each child's hook.
This .github/skills/ document is operator guidance, not a deployed runtime skill.
Do not design overlapping response plans around an assumed priority or specificity rule. Treat multiple matches as undefined, keep purpose-built filters mutually exclusive where routing matters, and make any fallback both positively scoped and explicitly exclude every known route.
Post-provision configuration
Run:
.\scripts\setup-sre-agent.ps1Only run that command with authorization to modify live configuration. For a
local-only preview, use -ResourceGroup rg-example -RenderOnly; it does not
authenticate or make network calls.
The script waits for API readiness, applies the staged connector template through ARM, checks evidence-tool registration, and applies and reads back skills, then agents/hooks, then response plans. It refuses to publish the global routing hint until referenced skills and agents converge. It also uploads knowledge files, syncs agent-global custom instructions, and enables the Microsoft Learn MCP tools.
Matching skills, agents, response plans, and instructions skip writes. If a managed
definition or nonempty global instructions differ from source, setup stops before
writes. Inspect the live definition
and the reported changed fields; only then explicitly rerun with -UpdateExisting.
The script first saves previous managed definitions/instructions to the user's
local application-data sre-agent/snapshots directory, or -SnapshotDirectory
outside any Git checkout. Never commit those private snapshots. It preserves
unmanaged objects and tags; there is no prune mode. Existing agents use PATCH to
preserve settings outside the lab manifest. Rereads detect edits since preflight,
but this is not a transactional multi-object deployment.
Connectors retain incremental Bicep apply semantics, preserving unmanaged names
and existing tags. Source IDs and some connector fields are redacted by the API;
only exposed type, identity, and provisioning state are compared. Changing an
existing type/identity requires -UpdateExisting; other declared connector
settings are reapplied from source. Do not describe redacted snapshots as a
complete rollback backup.
-ReadinessTimeoutSeconds (default 900) bounds startup polling;
-ConnectorTimeoutSeconds (default 600) bounds the connector deployment and its
transient retries. Authentication failures stop immediately. On deployment timeout,
setup requests cancellation; inspect the reported deployment before retrying.
The script reads every *.md under sre-config/knowledge-base/, substitutes
@@RG@@ -> the actual resource group, computes a SHA256, and uploads only files
whose content has changed since the last run (cache in
sre-config/knowledge-base/.upload-hashes.json). To add new agent knowledge:
- Drop a new
*.mdfile intosre-config/knowledge-base/ - Use
@@RG@@placeholder anywhere you need the resource group name - Re-run
.\scripts\setup-sre-agent.ps1
To remove a knowledge file: delete the local .md, then delete the corresponding
<name>.md from the agent's Builder UI > Knowledge sources view (the
script does not delete remote files that are no longer present locally).
Keep global instructions short; detailed procedures belong in a skill so they load only when relevant.
Evidence skills and specialists
zava-investigation-coordination guides the meta agent, not a new incident
handler. It owns no operational cloud tools. The two zava-*-evidence skills own
read-only procedures and the two Monitor dependency names in manifest tools.
That array becomes the JSON API's properties.tools; Markdown frontmatter alone
is insufficient. Application/performance incident runbooks reuse the evidence
skills while retaining their authorized write tools and remediation sections.
The named specialists have nonempty handoffDescription, selected evidence
skills, explicit tools: ["ReadFile"], and child-only PreToolUse guards. Do not
empty all agent tool lists (workspace defaults can return), empty allowedSkills
(not a deny-all control), or install the guard globally. A hook pass must not
emit permissionDecision: allow. Adding a skill dependency must not silently
widen the guard's exact allowlist.
Default SkillOwned mode declares Monitor dependencies on the evidence skills.
-EvidenceToolMode ExplicitAgent also selects them on the specialists for
compatibility. Do not change a working profile's tool mode without confirming
the selected skill and tools are available on that deployment.
Run the local contracts with
python -B -m unittest discover -s .\tests -p 'test_*.py' -v (Python 3 and
PowerShell 7.4+, no packages). Follow the
configuration verification guide
after an authorized deployment. Local tests do not establish live tool availability.
When helping users
- "Add a skill or response plan" — edit
sre-config/agent-config.jsonand the relevant file undersre-config/skills/, then runsetup-sre-agent.ps1. - "Add a connector" — edit the manifest's
connectorsentries and runsetup-sre-agent.ps1after reviewing the change. Connector resources remain ARM/Bicep-managed through the staged template. - "Add a knowledge file" — drop the markdown under
sre-config/knowledge-base/and runsetup-sre-agent.ps1. - "Verify the agent is configured" — run
setup-sre-agent.ps1; Step 7 verifies the deployed properties. - Activity-log alerts gotcha — they fire as Sev4 regardless of the configured severity, so response plan filters must match all severities.
- Runbook philosophy — preserve the existing descriptions, tools, and
procedures when moving or editing files under
sre-config/skills/. - Kubernetes tool guidance — use
RunKubectlReadCommandandRunKubectlWriteCommanddirectly in runtime skills. Do not make runbooks depend on terminal-native kubectl. - "Add an evidence specialist" — add a manifest
agentsreference and a supported properties file; reuse the child hook, not a global hook. Preview locally first. Do not change response-plan handlers, IAM, connectors, network access, or self-management settings as part of this configuration change.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

