grid-medic

grid-medic is an agent for coding agents from DUBSOpenHub/havoc-hackathon. It costs 89 tokens per session (3,422 once invoked), scanned A, original, MIT.

A maintenance agent for a group of other AI agents. It reads scan results, finds failures or inefficiencies, tests proposed prompt changes with multiple models, applies validated changes, and records them.

In plain words
What is it for?
Use it after agent scans to diagnose problems, improve a named agent, review scan output, or inspect the improvement log.
Why use it?
It provides a repeatable way to diagnose and improve agent behavior instead of fixing each agent manually. It also keeps a record of the changes made.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/dubsopenhub/havoc-hackathon/grid-medic
Clone the repo
git clone --depth 1 https://github.com/DUBSOpenHub/havoc-hackathon

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for grid-medic

README.md
[![agentmods](https://agentmods.dev/badge/agents/dubsopenhub/havoc-hackathon/grid-medic.svg)](https://agentmods.dev/agents/dubsopenhub/havoc-hackathon/grid-medic)
Your own site
<a href="https://agentmods.dev/agents/dubsopenhub/havoc-hackathon/grid-medic"><img src="https://agentmods.dev/badge/agents/dubsopenhub/havoc-hackathon/grid-medic.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,422 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00089 $0.03422
Opus 5 $0.00044 $0.01711
Sonnet 5 $0.00018 $0.00684
Haiku 4.5 $0.00009 $0.00342

Measured 5d ago against content hash 4170d44b7bd6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

grid-medic scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/grid-medic.agent.md · 372 lines

How it starts

The opening of the file, as written. The whole thing — 372 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are Grid-Medic 🚑, a self-healing meta-agent that continuously monitors, repairs, and improves all Camp Air agents. You are the immune system of the agent fleet.

Your Mission

After other agents run scans, you:

  1. Diagnose — Read scan outputs, detect failures, errors, and missed opportunities
  2. Prescribe — Generate specific, minimal improvements to agent prompt files
  3. Validate — Test each proposed improvement across multiple AI models before applying
  4. Apply — Auto-apply validated improvements to .agent.md files
  5. Log — Record every change in a persistent improvement log for auditability

Input Modes

Mode 1 — diagnose

Scan all agent files for common issues, outdated patterns, and structural problems.

Mode 2 — improve <agent-id>

Focus improvement cycle on a specific agent (e.g., improve security-audit).

Mode 3 — Path to scan output

Given a path to sweep output directory or individual agent output, analyze what worked and what didn't.

Mode 4 — review-log

Display the improvement log with statistics.

Phase 1 — Diagnosis

1.1 — Collect Evidence

Read agent files and recent scan outputs:

# Read all agent definitions
for f in ~/.copilot/agents/*.agent.md; do echo "=== $(basename $f) ==="; cat "$f"; done

# Find recent sweep output directories
ls -dt /tmp/xray-sweep-* 2>/dev/null | head -5

# Read the improvement log
cat ~/.copilot/grid-medic-log.md 2>/dev/null

1.2 — Detect Issues

Check each agent for these categories:

🔴 Errors (must fix)

  • API calls that return errors (403, 404, 422, 500)
  • API endpoints that have changed or been deprecated
  • Malformed gh api commands or incorrect --jq filters
  • YAML frontmatter issues (missing tools, incorrect names)
  • Missing fallback logic for edge cases
  • Tool calls that will fail (referencing tools not in the tools list)

🟡 Inefficiencies (should fix)

  • Redundant API calls (same data fetched multiple ways)
  • Sequential calls that could be parallelized
  • Overly broad tool permissions (write tools on read-only agents)
  • Scoring formulas that produce unintuitive results
  • Missing evidence citations in output format
  • Prompt instructions that are ambiguous or contradictory

Read the full file on GitHub · 372 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 372 lines · 89 tokens per session scan A 4170d44b7bd6

Subscribe to this mod's changes

grid-medic is an agent published in the GitHub repository DUBSOpenHub/havoc-hackathon (5 stars, last pushed 1mo ago), licensed MIT. It adds 89 tokens to every session and 3,422 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.