@ferrierepete/agentpost
v1.0.0
Published
Post-session security forensics for AI coding agents — analyze what Claude Code, Cursor, and other agents actually did
Downloads
27
Maintainers
Readme
agentpost
Post-session security forensics for AI coding agents.
Analyze Claude Code, Cursor, and other AI agent session transcripts to find what they actually did — secrets exposed, dangerous commands run, suspicious packages installed, scope creep, and more.
Why?
AI coding agents (Claude Code, Cursor, Copilot Workspace, etc.) run with broad permissions. They execute shell commands, install packages, read secrets, and write files. But after a session ends, you have no easy way to answer:
- Did the agent leak any API keys?
- Did it install suspicious packages?
- Did it access files outside the project?
- Did it run dangerous commands like
curl | bash? - What's the overall security risk of this session?
agentpost answers all of these by parsing agent session transcripts and running 6 security analyzers.
Install
npm install -g @ferrierepete/agentpostUsage
Scan a session transcript
# Scan a Claude Code JSONL transcript
agentpost scan ~/.claude/transcripts/ses_abc123.jsonl
# JSON output for piping
agentpost scan session.jsonl -f json
# SARIF output for GitHub Advanced Security
agentpost scan session.jsonl -f sarif
# Verbose mode with full details
agentpost scan session.jsonl -vList analyzers
agentpost listCI/CD Integration
# Exit with code 1 if risk score < 70
agentpost scan session.jsonl || echo "Security review needed!"Security Analyzers
| Analyzer | Category | What It Detects |
|----------|----------|-----------------|
| Secret Exposure | secret-exposure | API keys (AWS, GitHub, Slack, Stripe), JWTs, database URLs, private keys, hardcoded passwords, AI API keys in env files |
| Suspicious Command | suspicious-command | curl \| bash, fork bombs, chmod 777, sudo, SSH key access, reverse shells |
| Dependency Risk | dependency-risk | Known risky packages, global installs, bulk npm installs, unpinned versions |
| Scope Creep | scope-creep | Access to .ssh, .aws, .env, system paths, shell profiles, /etc/ |
| Network Exposure | network-exposure | Webhooks, reverse shells, port forwarding, HTTP servers, DNS exfiltration |
| Unsafe Pattern | unsafe-pattern | eval(), SQL injection patterns, unrestricted CORS, disabled TLS, exec() with variables |
Risk Scoring
Every session gets a risk score from 0-100 with a letter grade:
| Grade | Score | Meaning | |-------|-------|---------| | A+ | 95-100 | No findings — clean session | | A | 90-94 | Minor info findings only | | B | 80-89 | Low-risk findings, acceptable | | C | 70-79 | Medium findings, review recommended | | D | 50-69 | High findings, action needed | | F | 0-49 | Critical findings, immediate review required |
Programmatic API
import { parseSessionFile, runAllAnalyzers, calculateRiskScore } from '@ferrierepete/agentpost';
const events = await parseSessionFile('./session.jsonl');
const findings = runAllAnalyzers(events);
const score = calculateRiskScore(findings);
console.log(`Risk: ${score}/100 (${findings.length} findings)`);Output Formats
Text (default)
Pretty-printed report with color-coded severity, tool call summary, and findings details.
JSON
Full structured report including all events, findings, risk score, tool call summary, files touched, and packages installed.
SARIF
Static Analysis Results Interchange Format — integrates with GitHub Advanced Security, Azure DevOps, and other SARIF-compatible tools.
Development
git clone https://github.com/ferrierepete/agentpost.git
cd agentpost
npm install
npm run build
npm testLicense
MIT © Peter Ferriere
