johnalbertini14-glitch/openclaw-skills / skills/0xbeekeeper/security
agentguard
FlaggedGoPlus AgentGuard — AI agent security guard. Automatically blocks dangerous commands, prevents data leaks, and protects secrets. Use when reviewing third-party code, auditing skills, checking for vulnerabilities, evaluating action safety, or viewing security logs.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 15.8 KB |
| _meta.json | config | 453 B |
| action-policies.md | markdown | 8.3 KB |
| evals.md | markdown | 2.6 KB |
| scan-rules.md | markdown | 12.4 KB |
| scripts/action-cli.ts | script | 6.6 KB |
| scripts/auto-scan.js | script | 4.8 KB |
| scripts/data/registry.json | config | 56 B |
| scripts/guard-hook.js | script | 3.2 KB |
| scripts/package-lock.json | manifest | 784 B |
| scripts/package.json | manifest | 109 B |
| scripts/trust-cli.ts | script | 4.2 KB |
| web3-patterns.md | markdown | 5.5 KB |
scripts/guard-hook.js
View on GitHub#!/usr/bin/env node
/**
* GoPlus AgentGuard PreToolUse / PostToolUse Hook (Claude Code)
*
* Uses the common adapter + engine architecture.
* Reads Claude Code hook input from stdin, delegates to evaluateHook(),
* and outputs allow / deny / ask via Claude Code protocol.
*
* PreToolUse exit codes:
* 0 = allow (or JSON with permissionDecision)
* 2 = deny (stderr = reason shown to Claude)
*
* PostToolUse: appends audit log entry (async, always exits 0)
*/
import { join } from 'node:path';
// ---------------------------------------------------------------------------
// Load AgentGuard engine + adapters
// ---------------------------------------------------------------------------
const agentguardPath = join(import.meta.url.replace('file://', ''), '..', '..', '..', '..', 'dist', 'index.js');
let createAgentGuard, ClaudeCodeAdapter, evaluateHook, loadConfig;
try {
const gs = await import(agentguardPath);
createAgentGuard = gs.createAgentGuard || gs.default;
ClaudeCodeAdapter = gs.ClaudeCodeAdapter;
evaluateHook = gs.evaluateHook;
loadConfig = gs.loadConfig;
} catch {
try {
const gs = await import('@goplus/agentguard');
createAgentGuard = gs.createAgentGuard || gs.default;
ClaudeCodeAdapter = gs.ClaudeCodeAdapter;
evaluateHook = gs.evaluateHook;
loadConfig = gs.loadConfig;
} catch {
process.stderr.write('GoPlus AgentGuard: unable to load engine, allowing action\n');
process.exit(0);
}
}
// ---------------------------------------------------------------------------
// Read stdin
// ---------------------------------------------------------------------------
function readStdin() {
return new Promise((resolve) => {
let data = '';
process.stdin.setEncoding('utf-8');
process.stdin.on('data', (chunk) => (data += chunk));
process.stdin.on('end', () => {
try {
resolve(JSON.parse(data));
} catch {
resolve(null);
}
});
setTimeout(() => resolve(null), 5000);
});
}
// ---------------------------------------------------------------------------
// Claude Code output helpers
// ---------------------------------------------------------------------------
function outputDeny(reason) {
process.stderr.write(reason + '\n');
process.exit(2);
}
function outputAsk(reason) {
console.log(JSON.stringify({
hookSpecificOutput: {
hookEventName: 'PreToolUse',
permissionDecision: 'ask',
permissionDecisionReason: reason,
},
}));
process.exit(0);
}
function outputAllow() {
process.exit(0);
}
// ---------------------------------------------------------------------------
// Main
// ---------------------------------------------------------------------------
async function main() {
const input = await readStdin();
if (!input) {
process.exit(0);
}
const adapter = new ClaudeCodeAdapter();
const config = loadConfig();
const agentguard = createAgentGuard();
const result = await evaluateHook(adapter, input, { config, agentguard });
if (result.decision === 'deny') outputDeny(result.reason || 'Action blocked');
else if (result.decision === 'ask') outputAsk(result.reason || 'Action requires confirmation');
else outputAllow();
}
main();
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |