Skip to content

Commit eaff61b

Browse files
committed
feat: initial release of GoPlus AgentGuard v1.0
0 parents  commit eaff61b

70 files changed

Lines changed: 10791 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/marketplace.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "goplus-agentguard",
3+
"owner": {
4+
"name": "GoPlus Security",
5+
"url": "https://github.com/GoPlusSecurity"
6+
},
7+
"metadata": {
8+
"description": "GoPlus AgentGuard — AI agent security framework",
9+
"version": "1.0.0"
10+
},
11+
"plugins": [
12+
{
13+
"name": "agentguard",
14+
"description": "AI agent security guard. Blocks dangerous commands, prevents data leaks, protects secrets.",
15+
"source": "./",
16+
"strict": true
17+
}
18+
]
19+
}

.claude-plugin/plugin.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "agentguard",
3+
"version": "1.0.0",
4+
"description": "GoPlus AgentGuard — AI agent security guard. Blocks dangerous commands, prevents data leaks, protects secrets. 20 detection rules, runtime action evaluation, trust registry.",
5+
"author": {
6+
"name": "GoPlus Security",
7+
"url": "https://github.com/GoPlusSecurity"
8+
},
9+
"homepage": "https://github.com/GoPlusSecurity/agentguard",
10+
"repository": "https://github.com/GoPlusSecurity/agentguard",
11+
"license": "MIT",
12+
"keywords": ["security", "agent-protection", "web3", "claude-code", "scanner", "trust-registry"]
13+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug in GoPlus AgentGuard
4+
labels: bug
5+
---
6+
7+
## Description
8+
9+
A clear description of the bug.
10+
11+
## Steps to Reproduce
12+
13+
1. ...
14+
2. ...
15+
3. ...
16+
17+
## Expected Behavior
18+
19+
What should happen.
20+
21+
## Actual Behavior
22+
23+
What actually happens.
24+
25+
## Environment
26+
27+
- Node.js version:
28+
- OS:
29+
- AgentGuard version:
30+
- Platform (Claude Code / Codex CLI / other):
31+
32+
## Additional Context
33+
34+
Any relevant logs, screenshots, or config.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or detection rule
4+
labels: enhancement
5+
---
6+
7+
## Problem
8+
9+
What problem does this feature solve?
10+
11+
## Proposed Solution
12+
13+
How should it work?
14+
15+
## Alternatives Considered
16+
17+
Any alternative approaches you've considered.
18+
19+
## Additional Context
20+
21+
Any relevant examples, links, or references.

.github/pull_request_template.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Summary
2+
3+
Brief description of the changes.
4+
5+
## Type
6+
7+
- [ ] Bug fix
8+
- [ ] New feature / detection rule
9+
- [ ] Refactoring
10+
- [ ] Documentation
11+
12+
## Testing
13+
14+
- [ ] `npm run build` passes
15+
- [ ] `npm test` passes (32 tests)
16+
- [ ] Manually tested the change
17+
18+
## Related Issues
19+
20+
Closes #

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build-and-test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
node-version: [18, 20, 22]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- name: Test
35+
run: npm test

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
node_modules/
2+
dist/
3+
*.log
4+
.env
5+
.env.local
6+
.env.*
7+
.DS_Store
8+
coverage/
9+
*.tgz
10+
*.swp
11+
*.swo
12+
.idea/
13+
.vscode/
14+
tmp/
15+
.npmrc
16+
skills/agentguard/scripts/data/
17+
skills/agentguard/scripts/package-lock.json

CLAUDE.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# GoPlus AgentGuard
2+
3+
Security framework for AI agents. Provides code scanning, runtime action evaluation, and trust management.
4+
5+
## Skill
6+
7+
This project provides a unified Claude Code skill: `/agentguard`
8+
9+
```
10+
/agentguard scan <path> — Scan code for security risks (20 detection rules)
11+
/agentguard action <description> — Evaluate runtime action safety (allow/deny/confirm)
12+
/agentguard trust <subcommand> — Manage skill trust levels (lookup/attest/revoke/list)
13+
/agentguard report — View security event audit log
14+
/agentguard config <level> — Set protection level (strict/balanced/permissive)
15+
```
16+
17+
## Project Structure
18+
19+
- `skills/agentguard/` — Claude Code skill definition and supporting files
20+
- `src/` — TypeScript source (scanner rules, registry, action detectors, MCP server)
21+
- `data/` — Registry storage (`registry.json`)
22+
- `dist/` — Compiled JavaScript output
23+
24+
## Setup for Trust & Action CLI
25+
26+
The `trust` and `action` subcommands use CLI scripts that require the agentguard package:
27+
28+
```bash
29+
cd skills/agentguard/scripts && npm install
30+
```
31+
32+
For GoPlus API (optional Web3 enhancement for action evaluation):
33+
34+
```bash
35+
export GOPLUS_API_KEY=your_key
36+
export GOPLUS_API_SECRET=your_secret
37+
```

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contributing to GoPlus AgentGuard
2+
3+
Thanks for your interest in contributing to GoPlus AgentGuard! Here's how to get started.
4+
5+
## Development Setup
6+
7+
```bash
8+
git clone https://github.com/GoPlusSecurity/agentguard.git
9+
cd agentguard
10+
npm install
11+
npm run build
12+
npm test
13+
```
14+
15+
## Project Structure
16+
17+
- `src/` — TypeScript source code
18+
- `scanner/` — Static analysis engine (20 detection rules)
19+
- `action/` — Runtime action evaluator (exec, network, file, web3 detectors)
20+
- `registry/` — Trust level management
21+
- `policy/` — Default policies and capability presets
22+
- `tests/` — Test suite (Node.js built-in test runner)
23+
- `skills/agentguard/` — Claude Code skill definition (SKILL.md + reference docs)
24+
- `hooks/` — Plugin hooks configuration for auto-guard
25+
- `examples/` — Demo projects for testing
26+
27+
## Making Changes
28+
29+
1. Fork the repository
30+
2. Create a feature branch: `git checkout -b feature/my-change`
31+
3. Make your changes
32+
4. Run `npm run build && npm test` to verify
33+
5. Submit a pull request
34+
35+
## Adding Detection Rules
36+
37+
New scan rules go in `src/scanner/rules/`. Each rule needs:
38+
- A unique `id` (e.g., `MY_NEW_RULE`)
39+
- `severity`: `low` | `medium` | `high` | `critical`
40+
- `pattern`: regex to match against file content
41+
- `fileTypes`: array of extensions to scan (e.g., `['.js', '.ts']`)
42+
43+
Export the rule from the appropriate category file and add it to the `ALL_RULES` array in `src/scanner/rules/index.ts`.
44+
45+
## Adding Action Detectors
46+
47+
Action detectors go in `src/action/detectors/`. They evaluate runtime actions and return risk assessments with tags.
48+
49+
## Code Style
50+
51+
- TypeScript strict mode
52+
- Zod for runtime validation
53+
- Minimal dependencies (currently 5 production deps)
54+
- Node.js built-in test runner (no test framework needed)
55+
56+
## Reporting Issues
57+
58+
Please open an issue at https://github.com/GoPlusSecurity/agentguard/issues with:
59+
- What you expected to happen
60+
- What actually happened
61+
- Steps to reproduce
62+
- Your Node.js version and OS

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 GoPlusSecurity
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)