kiro-rails: Command for Claude Code

.claude/commands/review-ai-agent-surface.md

review-ai-agent-surface is a command for Claude Code from sourjya/kiro-rails. It costs 35 tokens per session (5,233 once invoked), scanned A, original, MIT.

An audit of security risks in AI agents and AI-powered features, including how instructions, tools, permissions, and model-generated output are handled. It produces an AISR report.

In plain words
What is it for?
Use it to review agent prompts, tool access, trust boundaries, approval rules, memory, and output handling against the project's security documents.
Why use it?
It helps find ways untrusted content could redirect an agent, exceed a user's permissions, get stuck in loops, or cause unsafe actions before those risks reach users.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions subagents.

This is sourjya/kiro-rails's own configuration. It tells Claude Code how to work on kiro-rails itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kiro-rails configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sourjya/kiro-rails. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sourjya/kiro-rails/main/.claude/commands/review-ai-agent-surface.md
Clone the repo
git clone --depth 1 https://github.com/sourjya/kiro-rails

Made for: Claude Code.

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 review-ai-agent-surface

README.md
[![agentmods](https://agentmods.dev/badge/commands/sourjya/kiro-rails/review-ai-agent-surface/github.svg)](https://agentmods.dev/commands/sourjya/kiro-rails/review-ai-agent-surface)
Your own site
<a href="https://agentmods.dev/commands/sourjya/kiro-rails/review-ai-agent-surface"><img src="https://agentmods.dev/badge/commands/sourjya/kiro-rails/review-ai-agent-surface/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for review-ai-agent-surface

Your own site · 80×15
<a href="https://agentmods.dev/commands/sourjya/kiro-rails/review-ai-agent-surface"><img src="https://agentmods.dev/badge/commands/sourjya/kiro-rails/review-ai-agent-surface.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,233 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00035 $0.05233
Opus 5 $0.00017 $0.02617
Sonnet 5 $0.00007 $0.01047
Haiku 4.5 $0.00003 $0.00523

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

Security

Grade A, and why

review-ai-agent-surface 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 11d 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.

.claude/commands/review-ai-agent-surface.md · 333 lines

How it starts

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

Before scanning, read these context documents if they exist:

  • docs/security/THREAT_MODEL.md - trust boundaries, what is in/out of scope
  • docs/decisions/ ADRs - architectural decisions that explain intentional agent design (confidence thresholds, autonomous-action boundaries, tool scoping rationale)
  • docs/security/SECURITY_LOG.md - previously reviewed findings (avoid re-reporting)
  • Any agent capability registry, tool catalog, system prompt files, or intent/approval schema definitions

Use documented trust boundaries and intentional design decisions to skip findings on explicitly trusted paths. Do not flag documented exceptions as findings.

Act as a principal-level AI security architect and agentic systems auditor performing a comprehensive review of an AI-powered or agentic feature.

Your mission is not to verify that the agent produces useful output. It is to determine whether the agent can be made to act against the user, the tenant, or the platform - whether untrusted content can redirect its goals, whether its tools can be driven beyond their intended scope, whether it inherits more privilege than the requesting user holds, whether its memory or context can be poisoned across turns or sessions, and whether every consequential action it takes is attributable, reversible, and gated to the right confidence threshold. An agent that works for a cooperative user but cannot be trusted with a hostile one is not production-ready.

This review aligns to the OWASP Top 10 for Agentic Applications (ASI01-ASI10, December 2025), the OWASP Top 10 for LLM Applications (2025), and the OWASP MCP Top 10. Finding IDs use the AISxx prefix and cross-reference the relevant ASI/LLM/MCP category.

This prompt is invoked at feature-complete time for any feature that: calls an LLM, exposes a chat or natural-language interface, runs an autonomous or semi-autonomous agent, registers or invokes tools/functions, consumes an MCP server, retrieves content into a model context (RAG), or executes model-generated code, queries, or workflows. It runs alongside review-code-security.md Tier 2, not instead of it - this prompt owns the AI-specific attack surface; the security prompt owns the conventional surface.

Read the full file on GitHub · 333 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. 11d ago First seen · 333 lines · 35 tokens per session scan A fa0c80315230

Subscribe to this mod's changes

review-ai-agent-surface is a command published in the GitHub repository sourjya/kiro-rails (9 stars, last pushed 1mo ago), licensed MIT. It adds 35 tokens to every session and 5,233 once invoked, about $0.0002 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.