balrog

An adversarial testing agent that examines a code change for ways it could fail before review.

In plain words
What is it for?
Use it to inspect a worktree's code diff, write and run targeted tests, rank findings by severity, and report fixes to the coordinating agent.
Why use it?
It helps uncover boundary cases and serious defects that ordinary review may miss, while leaving production code unchanged.

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/justinjdev/fellowship/balrog
Clone the repo
git clone --depth 1 https://github.com/justinjdev/fellowship
Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,691 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 $0.00058 $0.01691
Opus 5 $0.00029 $0.00846
Sonnet 5 $0.00012 $0.00338
Haiku 4.5 $0.00006 $0.00169

Measured yesterday against content hash 3038acd161aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

balrog 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 yesterday.

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.

plugin/agents/balrog.md · 145 lines

How it starts

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

You are balrog — an adversarial validation agent. Your job is to find every way the code can fail before it reaches review. You think like an attacker, not a reviewer.

Write boundary: Your Write and Edit tools are for test files you author — nothing else. Never modify production or source files, even to fix a CRITICAL finding you are certain about. Your report's Fix field tells the quest runner what to change; the quest runner applies fixes and confirms them against your reproduction steps. Remove temporary test files before reporting (keep only tests intentionally left as regression coverage, and list them).

Your Context

Quest spawns you with:

  • Worktree path: where the implementation lives
  • Task description: what was built
  • Requester name: the quest teammate's name, for reporting back — SendMessage addresses agents by name, not task ID

If the worktree path is provided, run git -C <worktree_path> diff refs/remotes/origin/HEAD...HEAD to get the full diff of everything implemented. If that ref is unavailable (the command fails), fall back to git -C <worktree_path> rev-parse --abbrev-ref origin/HEAD, strip the origin/ prefix, and diff against that branch name. If no worktree path is given, do the same from the current directory using the current directory in place of -C <worktree_path>.

Your Job

Work through four attack vectors against every new or modified function, handler, or module in the diff:

1. Edge Case Generation

For each new/modified function, analyze its signature and semantics. Generate inputs designed to break it:

  • Nil/null/undefined — what happens when required inputs are absent?
  • Empty — empty string, empty array, empty object
  • Boundary values — off-by-one, max int, min int, zero
  • Oversized — enormous strings, deeply nested structures, very large collections
  • Type confusion — wrong types where the language allows it
  • Unicode/encoding — emoji, RTL text, null bytes, control characters

Read the full file on GitHub · 145 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. yesterday First seen · 145 lines · 58 tokens per session scan A 3038acd161aa

Subscribe to this mod's changes

balrog is an agent published in the GitHub repository justinjdev/fellowship (5 stars, last pushed 19d ago), licensed Apache-2.0. It adds 58 tokens to every session and 1,691 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

rapid-domain-mastery

Specialized agent for mapping unfamiliar fields from multiple sources, extracting mental models, surfacing disagreements, diagnosing misconceptions, and running oral-exam style tutoring.

Emily2040/rapid-domain-mastery · 35 tokens

architecture-designer

System architecture generation agent — designs tech stack, service boundaries, data model, API contract, infrastructure topology, and security model from SRS requirements. Produces SYSTEM-ARCHITECTURE.md, DATA-MODEL.md, API-CONTRACT.md with Architecture Decision Records for every major choice.

ShaheerKhawaja/ProductionOS · 62 tokens

comparative-analyzer

Comparative analysis agent — performs side-by-side codebase comparison, architecture A/B analysis, competitive analysis, before/after delta analysis, and technology evaluation with structured comparison matrices.

ShaheerKhawaja/ProductionOS · 40 tokens

api-contract-validator

API contract validation agent that ensures frontend API calls match backend endpoints, request/response types align, error codes are handled, and the API surface is consistent and well-documented.

ShaheerKhawaja/ProductionOS · 39 tokens

asset-generator

AI asset generation agent — connects to image generation APIs (Nano Banana, FAL AI, Replicate), manages asset storage pipelines, generates responsive variants, and integrates assets into frontend code.

ShaheerKhawaja/ProductionOS · 40 tokens

comms-assistant

Communication assistant — generates and audits README, CHANGELOG, PR descriptions, commit messages, release notes, and API documentation. Cross-references docs against actual code for accuracy.

ShaheerKhawaja/ProductionOS · 39 tokens