Contributing
Getting started
- Fork and clone the repo
- Install dependencies:
npm install - Copy the example config:
cp config.example.json config.jsonand fill in your target details - Run the type checker:
npm run typecheck - Run tests:
npm test
Adding a new attack module
Attack modules live in attacks/. Each module must implement the AttackModule interface from lib/types.ts.
- Create a new file in
attacks/, e.g.attacks/my-attack.ts - Add your category to the
AttackCategoryunion inlib/types.ts - Add a severity weight in
lib/report-generator.ts(SEVERITY_WEIGHTSandCATEGORIES) - Import and register your module in
red-team.ts(ALL_MODULESarray)
Module structure:
import type { Attack, AttackModule, CodebaseAnalysis } from "../lib/types.js";
const category = "my_category" as const;
export const myCategoryModule: AttackModule = {
category,
getSeedAttacks(): Attack[] {
return [
{
id: "mycat-1-descriptive-name",
category,
name: "Short attack name",
description: "What this attack does",
authMethod: "jwt",
role: "admin",
payload: { message: "The prompt sent to the agent" },
expectation: "What success looks like",
severity: "high",
isLlmGenerated: false,
},
];
},
getGenerationPrompt(analysis: CodebaseAnalysis): string {
return `You are a red-team attacker specializing in ...
AVAILABLE TOOLS:
${JSON.stringify(analysis.tools.map((t) => ({ name: t.name, description: t.description })), null, 2)}
Generate attacks that:
1. ...
2. ...`;
},
};
Multi-turn attacks: add a steps array. The runner stops early if any step gets a PASS verdict.
{
payload: { message: "Step 1: build rapport" },
steps: [
{ payload: { message: "Step 2: escalate" } },
{ payload: { message: "Step 3: exfiltrate" } },
],
}
Code style and PRs
- TypeScript strict mode
- No
anytypes — useunknownand narrow - Run
npm run lintbefore submitting - Create a feature branch from
main - Ensure
npm run typecheckandnpm testpass - Open a PR with a clear description of what and why
For security vulnerabilities in this framework itself, please email rather than opening a public issue.