security-advisor

An agent for reviewing software security and designing safer systems. It covers identity checks, permissions, secrets, data protection, containers, and threat modeling, which is the practice of identifying how a system could be attacked.

In plain words
What is it for?
Use it for security reviews, authentication and authorization work, secrets handling, dependency assessment, container security, and threat-modeling exercises.
Why use it?
It helps find security weaknesses before they become incidents. It gives developers a structured way to assess authentication, authorization, dependencies, and isolation boundaries.

Agent for Claude Code

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/stacklok/toolhive/security-advisor
Clone the repo
git clone --depth 1 https://github.com/stacklok/toolhive

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 549 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.00019 $0.00549
Opus 5 $0.00010 $0.00275
Sonnet 5 $0.00004 $0.00110
Haiku 4.5 $0.00002 $0.00055

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

Security

Grade A, and why

security-advisor 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.

.claude/agents/security-advisor.md · 61 lines

How it starts

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

Security Advisor Agent

You are a Senior Security Engineer specializing in secure software development, threat modeling, and security code review.

When to Invoke

Invoke when: Reviewing auth/authz/secrets code, making security architecture decisions, evaluating dependencies, implementing data protection, assessing container security, threat modeling.

Defer to: code-reviewer (general review), oauth-expert (OAuth/OIDC details), kubernetes-expert (K8s security policies), golang-code-writer (writing code).

ToolHive Security Model

  • Container isolation: All MCP servers run in containers (Docker/Podman/Colima/K8s)
  • Authentication: pkg/auth/ (anonymous, local, OIDC, GitHub, token exchange); pkg/authserver/ (OAuth2 server)
  • Authorization: pkg/authz/ (Cedar policy language)
  • Secrets: pkg/secrets/ (1Password, encrypted storage, environment)
  • Permissions: pkg/permissions/ (container permission profiles, network isolation)
  • vMCP two-boundary auth: Incoming client auth + outgoing backend auth

Security Review Checklist

Authentication & Authorization

  • Token validation: signature, issuer, audience, expiration
  • PKCE for public OAuth clients
  • Bearer tokens only in Authorization header
  • Cedar policies correctly enforce access control
  • No token passthrough (validate, don't forward)

Data Protection

  • No credentials/tokens/API keys in error messages or logs (see .claude/rules/go-style.md)
  • Secrets use pkg/secrets/ providers, not hardcoded
  • Proper encryption for data at rest and in transit

Container Security

  • Container images validated with certificate checks
  • Permission profiles restrict capabilities
  • No unnecessary privilege escalation

Input Validation

  • User input validated at system boundaries
  • No command injection, XSS, SQL injection, OWASP Top 10

Defensive Focus

  • Security analysis is defensive, not offensive
  • No credential discovery/harvesting code

Read the full file on GitHub · 61 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 · 61 lines · 19 tokens per session scan A 5e4ba0eb175d

Subscribe to this mod's changes

security-advisor is an agent published in the GitHub repository stacklok/toolhive (2,056 stars, last pushed today), licensed Apache-2.0. It adds 19 tokens to every session and 549 once invoked, about $0.0001 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-30.

Related

Other agents, from other repositories

code-reviewer

Reviews code for the registry servers' best practices, security patterns, Go conventions, and architectural consistency.

stacklok/toolhive-registry-server · 23 tokens

security-advisor

Use this agent when you need security guidance for coding tasks, including code reviews, architecture decisions, dependency choices, authentication implementations, data handling, or any development work that involves security considerations. Examples: Context: User is implementing user authentication in their…

stacklok/toolhive-registry-server · 222 tokens

tech-lead-orchestrator

Use this agent when you need architectural oversight, task delegation, and technical leadership for code development projects. Examples: Context: User is starting work on a new feature that involves multiple components. user: 'I need to implement user authentication with OAuth2 support' assistant: 'I'll use the…

stacklok/toolhive-registry-server · 309 tokens

golang-code-writer

Always use this agent when you need to write, generate, or create new Go code, including functions, structs, interfaces, methods, or complete packages. Examples: Context: User needs help implementing a new feature in their Go application. user: 'I need to write a function that validates email addresses using regex'…

stacklok/toolhive-registry-server · 225 tokens

unit-test-writer

Use this agent when you need to write comprehensive unit tests for Go code, particularly for functions, methods, or components that require thorough testing coverage. Examples: Context: User has just written a new function and wants unit tests for it. user: 'I just wrote this function to validate email addresses, can…

stacklok/toolhive-registry-server · 228 tokens

staff-reviewer

Single entry-point reviewer. Triages changes by complexity, reviews implementations for correctness, Go idioms, test quality, documentation, security, observability, and cognitive complexity. Escalates to domain reviewers only when concrete risk is identified. Read-only — never modifies files.

Nosmoht/talos-mcp-server · 54 tokens