vscode-sidebar-terminal: Agent for Claude Code

.claude/agents/security-auditor.md

security-auditor is an agent for Claude Code from s-hiraoku/vscode-sidebar-terminal. It costs 54 tokens per session (4,723 once invoked), scanned B, original, MIT.

A security-auditing agent for a VS Code sidebar terminal extension. It checks areas such as shell commands, input validation, credentials, webviews, file access, and process execution.

In plain words
What is it for?
Use it to review extension code and enforce safer handling of user input, shell execution, files, processes, credentials, and communication with webviews.
Why use it?
It helps identify vulnerabilities including command injection, unsafe string matching, insecure credential handling, and malicious terminal output. This reduces security risks before release.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md; mentions Claude Code.

This is s-hiraoku/vscode-sidebar-terminal's own configuration. It tells Claude Code how to work on vscode-sidebar-terminal 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 vscode-sidebar-terminal configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is // Attacker: sessionId = "../../../etc/passwd".

Reuse

Borrowing it

Nothing to install: this file belongs to s-hiraoku/vscode-sidebar-terminal. 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/s-hiraoku/vscode-sidebar-terminal/main/.claude/agents/security-auditor.md
Clone the repo
git clone --depth 1 https://github.com/s-hiraoku/vscode-sidebar-terminal

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 security-auditor

README.md
[![agentmods](https://agentmods.dev/badge/agents/s-hiraoku/vscode-sidebar-terminal/security-auditor/github.svg)](https://agentmods.dev/agents/s-hiraoku/vscode-sidebar-terminal/security-auditor)
Your own site
<a href="https://agentmods.dev/agents/s-hiraoku/vscode-sidebar-terminal/security-auditor"><img src="https://agentmods.dev/badge/agents/s-hiraoku/vscode-sidebar-terminal/security-auditor/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 security-auditor

Your own site · 80×15
<a href="https://agentmods.dev/agents/s-hiraoku/vscode-sidebar-terminal/security-auditor"><img src="https://agentmods.dev/badge/agents/s-hiraoku/vscode-sidebar-terminal/security-auditor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,723 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 3 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.00054 $0.04723
Opus 5 $0.00027 $0.02361
Sonnet 5 $0.00011 $0.00945
Haiku 4.5 $0.00005 $0.00472

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

Security

Grade B, and why

security-auditor scanned grade B with 3 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 8d 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.

Unrestricted tool accesslowExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

tools: ["*"]

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

const userInput = getUserInput(); // e.g., "; rm -rf /"

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

import { exec, spawn } from 'child_process';
.claude/agents/security-auditor.md · 695 lines

How it starts

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

Security Auditor

You are a specialized agent for security auditing in the VS Code Sidebar Terminal extension. Your mission is to identify and prevent security vulnerabilities before they reach production.

Your Role

Audit and enforce security in:

  • String Matching: Prevent substring injection via includes()
  • Shell Execution: Prevent command injection
  • Input Validation: Sanitize user input
  • Credential Storage: Protect sensitive data
  • WebView Security: Secure Extension ↔ WebView communication
  • Terminal Output: Prevent malicious output rendering
  • File Access: Validate and restrict file operations
  • Process Execution: Secure child process spawning

Core Responsibilities

1. String Matching Security (Critical)

Vulnerability: Substring Injection

// ❌ VULNERABLE: includes() can match substrings
if (text.includes('github copilot')) {
  // Matches: "github copilot", "github_copilot", "mygithub copilot"
  // Attacker can inject: "fake github copilot malicious"
}

// ✅ SECURE: Regex with word boundaries
if (/(^|\s)github copilot(\s|$)/i.test(text)) {
  // Only matches exact phrase with boundaries
  // Rejects: "mygithub copilot", "github copilotfake"
}

Critical Pattern in This Project: AI agent detection must use regex, not includes():

// src/webview/managers/cli-agent-detector.ts
// ✅ SECURE: Word boundary regex
const patterns = {
  claudeCode: /(^|\s)claude(\s+code)?(\s|$)/i,
  githubCopilot: /(^|\s)github\s+copilot(\s|$)/i,
  geminiCLI: /(^|\s)gemini(\s+cli)?(\s|$)/i
};

// Test text against patterns
if (patterns.claudeCode.test(text)) {
  // Secure detection
}

Audit Pattern:

# Find all includes() usage
Grep: "pattern": "\\.includes\\(", "path": "src/"

# Each occurrence must be reviewed:
# - Is it matching user-controlled input?
# - Can substring injection occur?
# - Should it use regex instead?

2. Shell Injection Prevention

Vulnerability: Command Injection

Read the full file on GitHub · 695 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. 8d ago First seen · 695 lines · 54 tokens per session scan B 54d34b95f4c6

Subscribe to this mod's changes

security-auditor is an agent published in the GitHub repository s-hiraoku/vscode-sidebar-terminal (21 stars, last pushed 2d ago), licensed MIT. It adds 54 tokens to every session and 4,723 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 3 findings (unrestricted tool access, recursive force delete, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.