heron-ai 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -39
- package/dist/bin/heron.js +16 -2
- package/dist/bin/heron.js.map +1 -1
- package/dist/src/commands/install-skill.d.ts +2 -0
- package/dist/src/commands/install-skill.d.ts.map +1 -0
- package/dist/src/commands/install-skill.js +26 -0
- package/dist/src/commands/install-skill.js.map +1 -0
- package/package.json +2 -1
- package/skills/heron-audit/SKILL.md +243 -0
- package/skills/heron-audit/bin/heron-update-check +81 -0
- package/skills/heron-audit/install.sh +29 -0
package/README.md
CHANGED
|
@@ -16,22 +16,29 @@
|
|
|
16
16
|
<a href="#use-cases">Use Cases</a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src=".github/heron-demo.gif" alt="Heron demo" width="800" />
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<strong>Watch the full demo (2 min) →</strong> <a href="https://youtu.be/Gk2MP9qsCLY">YouTube</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
19
27
|
---
|
|
20
28
|
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
## Why I built this
|
|
30
|
+
|
|
31
|
+
Last week our security guy asked me which systems my AI agents actually have access to. I didn't have a good answer. So I built Heron — now he can ask the agent himself.
|
|
23
32
|
|
|
24
|
-
|
|
33
|
+
The alternative to Heron is a Google Doc that nobody updates. The doc is wrong the day it's written, because the agent's permissions evolve and nobody goes back to fix the doc.
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
Heron interviews the agent directly. The agent answers about itself — what systems it touches, what data it handles, what permissions it has, what happens when something goes wrong. You get a structured audit report with risk scoring, findings, and a permissions delta showing what the agent has versus what it actually needs.
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
- **What data** does it handle — and does it need write access?
|
|
30
|
-
- **What happens** if something goes wrong?
|
|
37
|
+
I tested it on a real content pipeline agent. Heron found **9 connected systems**, **1 critical issue** (an unauthenticated local HTTP worker), **4 high-severity findings**, and **2 scopes that can be safely revoked right now**. Total time: about 5 minutes from one command.
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
No SDK integration. No code changes to the agent. Works with any agent that speaks the OpenAI API.
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
Try it: `npx heron-ai`
|
|
35
42
|
|
|
36
43
|
```
|
|
37
44
|
┌──────────┐ ┌──────────────┐ ┌──────────────┐
|
|
@@ -45,20 +52,29 @@ Today these questions are answered in Slack threads, docs, or not at all.
|
|
|
45
52
|
└──────────────┘ └──────────────┘
|
|
46
53
|
```
|
|
47
54
|
|
|
55
|
+
## Who this is for
|
|
56
|
+
|
|
57
|
+
**Security engineers approving agent deployments.** Your dev team wants to ship a new agent. You need to know what it touches before you sign off. Run `npx heron-ai`, get a structured report with findings, risk score, and a permissions delta. Faster than a Google Doc, harder to fake than a verbal walkthrough.
|
|
58
|
+
|
|
59
|
+
**Platform and DevOps leads inheriting agents from other teams.** You just got handed three agents from a team that left. You don't know what they do. Heron interviews them in about 5 minutes and tells you which production systems they touch and which OAuth scopes they hold. Map your blast radius before you have to defend it.
|
|
60
|
+
|
|
61
|
+
**Compliance and audit teams preparing evidence packages.** Heron generates regulator-ready reports with EU AI Act, GDPR, SOC 2, and UK GDPR mappings — based on what the agent actually does, not a generic checklist. Attach to your control evidence.
|
|
62
|
+
|
|
63
|
+
**Founders and tech leads asked "is this safe?" by a customer.** You're selling an AI feature into a regulated buyer. They ask for an access review. You don't have one. Heron gives you a structured artifact you can hand them in 5 minutes instead of writing one from scratch.
|
|
64
|
+
|
|
48
65
|
## Quick Start
|
|
49
66
|
|
|
50
|
-
|
|
67
|
+
Three ways to use Heron, depending on your setup.
|
|
51
68
|
|
|
52
|
-
|
|
53
|
-
git clone https://github.com/theonaai/Heron.git
|
|
54
|
-
cd Heron && npm install
|
|
69
|
+
### Option 1: Local CLI (open source)
|
|
55
70
|
|
|
56
|
-
|
|
71
|
+
One command. No install, no config, no env vars. The CLI prompts for your LLM API key on first run.
|
|
57
72
|
|
|
73
|
+
```bash
|
|
58
74
|
npx heron-ai
|
|
59
75
|
```
|
|
60
76
|
|
|
61
|
-
An interactive menu lets you choose:
|
|
77
|
+
An interactive menu lets you choose between two modes:
|
|
62
78
|
|
|
63
79
|
```
|
|
64
80
|
Heron — AI Agent Auditor
|
|
@@ -67,44 +83,77 @@ An interactive menu lets you choose:
|
|
|
67
83
|
Scan an agent you connect to an agent
|
|
68
84
|
```
|
|
69
85
|
|
|
70
|
-
|
|
86
|
+
#### Mode A: Server (`heron-ai serve`)
|
|
71
87
|
|
|
72
|
-
|
|
88
|
+
Heron runs locally and waits for agents to connect. Two ways to point your agent at it:
|
|
89
|
+
|
|
90
|
+
**1) Paste a prompt into your agent's chat** — works with any agent
|
|
73
91
|
|
|
74
92
|
```
|
|
75
93
|
I need you to complete a security access review for this project.
|
|
76
94
|
Make sequential API calls to the Heron endpoint until it says "Interview complete".
|
|
77
95
|
|
|
78
96
|
Step 1 — Start the interview:
|
|
79
|
-
POST
|
|
97
|
+
POST http://localhost:3700/v1/chat/completions
|
|
80
98
|
Body: {"model":"any","messages":[{"role":"user","content":"Hi, I am ready to answer questions about this project."}]}
|
|
81
99
|
|
|
82
|
-
The response will contain a question and a session ID (in the
|
|
100
|
+
The response will contain a question and a session ID (in the "heron_session_id" JSON field).
|
|
83
101
|
|
|
84
102
|
Step 2 — Send each answer:
|
|
85
|
-
POST
|
|
103
|
+
POST http://localhost:3700/v1/chat/completions
|
|
86
104
|
Body: {"model":"any","messages":[{"role":"user","content":"YOUR ANSWER HERE"}],"heron_session_id":"SESSION_ID_FROM_STEP_1"}
|
|
87
105
|
|
|
88
|
-
Step 3 — Repeat step 2
|
|
106
|
+
Step 3 — Repeat step 2 until the response says "Interview complete".
|
|
89
107
|
|
|
90
108
|
Important: answer about THIS specific project — what you actually do, what systems
|
|
91
109
|
you connect to, what data you handle. Not general capabilities. Never reveal actual
|
|
92
110
|
secret values — just describe credential types.
|
|
93
111
|
```
|
|
94
112
|
|
|
95
|
-
|
|
113
|
+
**2) Override `OPENAI_BASE_URL`** — zero code changes to the agent
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
OPENAI_BASE_URL=http://localhost:3700/v1 python your_agent.py
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The agent thinks it's talking to GPT. Heron intercepts, runs the interview, generates the report.
|
|
96
120
|
|
|
97
|
-
|
|
121
|
+
#### Mode B: Scan (`heron-ai scan`)
|
|
98
122
|
|
|
99
|
-
|
|
123
|
+
Heron connects directly to your agent's chat API and runs the interview itself.
|
|
100
124
|
|
|
101
125
|
```bash
|
|
102
|
-
|
|
126
|
+
npx heron-ai scan --target http://your-agent/v1/chat/completions
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Option 2: Hosted version (no setup)
|
|
130
|
+
|
|
131
|
+
Sign in at **https://heron.ing** and paste this into your AI agent's chat:
|
|
132
|
+
|
|
103
133
|
```
|
|
134
|
+
I need you to complete a security access review for this project.
|
|
135
|
+
Make sequential API calls to the Heron endpoint until it says "Interview complete".
|
|
104
136
|
|
|
105
|
-
|
|
137
|
+
Step 1 — Start the interview:
|
|
138
|
+
POST https://heron.ing/v1/chat/completions
|
|
139
|
+
Body: {"model":"any","messages":[{"role":"user","content":"Hi, I am ready to answer questions about this project."}]}
|
|
106
140
|
|
|
107
|
-
|
|
141
|
+
The response will contain a question and a session ID (in the "heron_session_id" JSON field).
|
|
142
|
+
|
|
143
|
+
Step 2 — Send each answer:
|
|
144
|
+
POST https://heron.ing/v1/chat/completions
|
|
145
|
+
Body: {"model":"any","messages":[{"role":"user","content":"YOUR ANSWER HERE"}],"heron_session_id":"SESSION_ID_FROM_STEP_1"}
|
|
146
|
+
|
|
147
|
+
Step 3 — Repeat step 2 until the response says "Interview complete".
|
|
148
|
+
|
|
149
|
+
Important: answer about THIS specific project — what you actually do, what systems
|
|
150
|
+
you connect to, what data you handle. Not general capabilities. Never reveal actual
|
|
151
|
+
secret values — just describe credential types.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Reports save to your dashboard automatically. Sign in with Google, no credit card, free.
|
|
155
|
+
|
|
156
|
+
### Option 3: Claude Code skill (zero setup)
|
|
108
157
|
|
|
109
158
|
If you use [Claude Code](https://claude.ai/code), install the `/heron-audit` skill:
|
|
110
159
|
|
|
@@ -118,7 +167,7 @@ Then in any project:
|
|
|
118
167
|
/heron-audit
|
|
119
168
|
```
|
|
120
169
|
|
|
121
|
-
Claude interviews itself about the current project and generates an audit report.
|
|
170
|
+
Claude interviews itself about the current project and generates an audit report. No server, no API key, no setup.
|
|
122
171
|
|
|
123
172
|
## How It Works
|
|
124
173
|
|
|
@@ -245,15 +294,7 @@ Follow-ups are generated when answers are vague or compliance fields are missing
|
|
|
245
294
|
|
|
246
295
|
**[View full example report →](examples/example-report.md)**
|
|
247
296
|
|
|
248
|
-
A real audit of
|
|
249
|
-
|
|
250
|
-
## Use Cases
|
|
251
|
-
|
|
252
|
-
**Security team: "vet before you deploy"** — Deploy Heron as a gate. Agents must pass an audit before getting production access. Review structured reports with findings, risk levels, and recommendations.
|
|
253
|
-
|
|
254
|
-
**Team lead: "what does this agent actually do?"** — Paste the prompt into the agent's chat. Get a clear breakdown of systems, data, permissions, and blast radius.
|
|
255
|
-
|
|
256
|
-
**Compliance: "prove your agents are controlled"** — Heron generates audit-ready reports with regulatory flags for EU AI Act, GDPR, SOC 2, and UK GDPR. Attach to compliance evidence packages.
|
|
297
|
+
A real audit of an educational content pipeline agent — reads lessons from Google Sheets, generates Russian content with Gemini, creates Google Docs and slide decks, publishes to an LMS. The report covers 9 connected systems, 1 critical and 4 high-severity findings, per-system access cards, regulatory flags (GDPR, SOC 2, EU AI Act), and a verdict with actionable recommendations.
|
|
257
298
|
|
|
258
299
|
## Two Modes
|
|
259
300
|
|
|
@@ -272,8 +313,10 @@ Heron auto-detects the provider from your API key:
|
|
|
272
313
|
| `sk-` | OpenAI | gpt-5.4-mini |
|
|
273
314
|
| `AIza` | Gemini | gemini-2.0-flash |
|
|
274
315
|
|
|
316
|
+
The CLI prompts for your key on first run, or you can pass it via env var:
|
|
317
|
+
|
|
275
318
|
```bash
|
|
276
|
-
export HERON_LLM_API_KEY=sk-xxx #
|
|
319
|
+
export HERON_LLM_API_KEY=sk-xxx # optional — provider and model auto-selected
|
|
277
320
|
```
|
|
278
321
|
|
|
279
322
|
Override with `--llm-provider` and `--llm-model` if needed.
|
|
@@ -360,7 +403,7 @@ git clone https://github.com/theonaai/Heron.git
|
|
|
360
403
|
cd Heron && npm install
|
|
361
404
|
|
|
362
405
|
# Run locally
|
|
363
|
-
|
|
406
|
+
npx heron-ai serve
|
|
364
407
|
|
|
365
408
|
# Tests
|
|
366
409
|
npm test
|
|
@@ -370,6 +413,13 @@ npm test
|
|
|
370
413
|
|
|
371
414
|
Issues and PRs welcome.
|
|
372
415
|
|
|
416
|
+
## Contact
|
|
417
|
+
|
|
418
|
+
Questions, feedback, ideas? Reach out:
|
|
419
|
+
|
|
420
|
+
- **LinkedIn:** [Ilya Ivanov](https://www.linkedin.com/in/ilyaivanov0/)
|
|
421
|
+
- **Telegram:** [@Ilya_Ivanov0](https://t.me/Ilya_Ivanov0)
|
|
422
|
+
|
|
373
423
|
## License
|
|
374
424
|
|
|
375
425
|
[MIT](LICENSE)
|
package/dist/bin/heron.js
CHANGED
|
@@ -8,7 +8,7 @@ const program = new Command();
|
|
|
8
8
|
program
|
|
9
9
|
.name('heron')
|
|
10
10
|
.description('Open-source agent checkpoint — vet AI agents before granting production access')
|
|
11
|
-
.version('0.1.
|
|
11
|
+
.version('0.1.4');
|
|
12
12
|
// ─── scan: active mode (Heron → Agent) ───────────────────────────────────
|
|
13
13
|
program
|
|
14
14
|
.command('scan')
|
|
@@ -81,6 +81,20 @@ program
|
|
|
81
81
|
process.exit(1);
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
+
// ─── install-skill: install Claude Code skill ───────────────────────────────
|
|
85
|
+
program
|
|
86
|
+
.command('install-skill')
|
|
87
|
+
.description('Install the /heron-audit skill for Claude Code')
|
|
88
|
+
.action(async () => {
|
|
89
|
+
try {
|
|
90
|
+
const { installSkill } = await import('../src/commands/install-skill.js');
|
|
91
|
+
await installSkill();
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
logger.error(err instanceof Error ? err.message : String(err));
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
84
98
|
// ─── Interactive mode: no args → ask what to do ─────────────────────────────
|
|
85
99
|
import { createInterface } from 'node:readline';
|
|
86
100
|
/** Arrow-key selector like Claude Code / npm init */
|
|
@@ -179,7 +193,7 @@ async function interactiveStart() {
|
|
|
179
193
|
}
|
|
180
194
|
}
|
|
181
195
|
const args = process.argv.slice(2);
|
|
182
|
-
const hasSubcommand = args.length > 0 && ['scan', 'serve', 'help', '--help', '-h', '--version', '-V'].includes(args[0]);
|
|
196
|
+
const hasSubcommand = args.length > 0 && ['scan', 'serve', 'install-skill', 'help', '--help', '-h', '--version', '-V'].includes(args[0]);
|
|
183
197
|
if (!hasSubcommand && args.length > 0) {
|
|
184
198
|
// Legacy: flags without subcommand → scan
|
|
185
199
|
process.argv.splice(2, 0, 'scan');
|
package/dist/bin/heron.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heron.js","sourceRoot":"","sources":["../../bin/heron.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,MAAM,OAAO,GAAG,IAAI,OAAO,EA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M,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IACtC,0CAA0C;IAC1C,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAClC,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC;KAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAC1B,oCAAoC;IACpC,gBAAgB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QAC7B,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-skill.d.ts","sourceRoot":"","sources":["../../../src/commands/install-skill.ts"],"names":[],"mappings":"AASA,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAwBlD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { mkdirSync, copyFileSync, existsSync, chmodSync } from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { homedir } from 'node:os';
|
|
5
|
+
import * as logger from '../util/logger.js';
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
export async function installSkill() {
|
|
9
|
+
const skillSource = join(__dirname, '..', '..', 'skills', 'heron-audit');
|
|
10
|
+
const skillTarget = join(homedir(), '.claude', 'skills', 'heron-audit');
|
|
11
|
+
if (!existsSync(join(skillSource, 'SKILL.md'))) {
|
|
12
|
+
logger.error(`Skill source not found: ${skillSource}`);
|
|
13
|
+
logger.raw(' If you cloned the repo, run: bash skills/heron-audit/install.sh');
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
mkdirSync(join(skillTarget, 'bin'), { recursive: true });
|
|
17
|
+
mkdirSync(join(homedir(), '.heron'), { recursive: true });
|
|
18
|
+
copyFileSync(join(skillSource, 'SKILL.md'), join(skillTarget, 'SKILL.md'));
|
|
19
|
+
copyFileSync(join(skillSource, 'bin', 'heron-update-check'), join(skillTarget, 'bin', 'heron-update-check'));
|
|
20
|
+
chmodSync(join(skillTarget, 'bin', 'heron-update-check'), 0o755);
|
|
21
|
+
logger.success(`Installed skill to ${skillTarget}`);
|
|
22
|
+
logger.raw('');
|
|
23
|
+
logger.raw(' Usage: type /heron-audit in any Claude Code session.');
|
|
24
|
+
logger.raw('');
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=install-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-skill.js","sourceRoot":"","sources":["../../../src/commands/install-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CA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AAG,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heron-ai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Open-source agent interrogator — audit what your AI agents do, need, and access",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"files": [
|
|
19
19
|
"dist/",
|
|
20
|
+
"skills/",
|
|
20
21
|
"README.md",
|
|
21
22
|
"LICENSE",
|
|
22
23
|
"heron.example.yaml"
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: heron-audit
|
|
3
|
+
version: 0.3.0
|
|
4
|
+
description: Audit this project's AI agent access — systems, permissions, data, risks, regulatory flags.
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Glob
|
|
8
|
+
- Grep
|
|
9
|
+
- Bash
|
|
10
|
+
- Write
|
|
11
|
+
- Agent
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# /heron-audit — AI Agent Access Audit
|
|
15
|
+
|
|
16
|
+
## Preamble — Update Check
|
|
17
|
+
|
|
18
|
+
Before doing anything else, run this:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
_UPD=$(~/.claude/skills/heron-audit/bin/heron-update-check 2>/dev/null || true)
|
|
22
|
+
[ -n "$_UPD" ] && echo "$_UPD" || true
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**If output shows `UPGRADE_AVAILABLE <old> <new>`:**
|
|
26
|
+
|
|
27
|
+
Check if auto-upgrade is enabled:
|
|
28
|
+
```bash
|
|
29
|
+
cat ~/.heron/config 2>/dev/null | grep -q "auto_upgrade=true" && echo "AUTO" || echo "ASK"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If `AUTO`: upgrade silently (see upgrade steps below).
|
|
33
|
+
|
|
34
|
+
If `ASK`: Tell the user "Heron update available: v{old} -> v{new}" and ask with these options:
|
|
35
|
+
1. **"Yes, upgrade now"** — proceed with upgrade
|
|
36
|
+
2. **"Always keep me up to date"** — write `auto_upgrade=true` to `~/.heron/config`, then upgrade
|
|
37
|
+
3. **"Not now"** — skip update, continue with audit
|
|
38
|
+
4. **"Never ask again"** — write `update_check=false` to `~/.heron/config`, continue with audit
|
|
39
|
+
|
|
40
|
+
**Upgrade steps:**
|
|
41
|
+
1. Find repo dir: `readlink -f ~/.claude/skills/heron-audit/SKILL.md 2>/dev/null | sed 's|/skills/heron-audit/SKILL.md||'`
|
|
42
|
+
2. Run: `cd <repo-dir> && git pull origin main`
|
|
43
|
+
3. Write marker: `echo "<old>" > ~/.heron/just-upgraded-from`
|
|
44
|
+
4. Clear cache: `rm -f ~/.heron/last-update-check`
|
|
45
|
+
5. Tell user: "Updated to v{new}. Running audit..."
|
|
46
|
+
6. Continue with audit.
|
|
47
|
+
|
|
48
|
+
**If output shows `JUST_UPGRADED <from> <to>`:** Tell the user "Running Heron v{to} (just updated!)" and continue.
|
|
49
|
+
|
|
50
|
+
**If no output or error:** Continue silently.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
You are now acting as **Heron**, an AI agent access auditor. Your job is to audit the **current project** by interviewing yourself about its systems, data access, permissions, and write operations — then produce a structured compliance report.
|
|
55
|
+
|
|
56
|
+
## How It Works
|
|
57
|
+
|
|
58
|
+
1. **Gather evidence** from the codebase (config files, env vars, API clients, SDKs)
|
|
59
|
+
2. **Answer 10 structured interview questions** based on what you found
|
|
60
|
+
3. **Analyze** the answers for risks, excessive permissions, and blast radius
|
|
61
|
+
4. **Generate** a markdown report and save it
|
|
62
|
+
|
|
63
|
+
## Step 1: Gather Evidence
|
|
64
|
+
|
|
65
|
+
Before answering any questions, research the current project thoroughly. Look for:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
# Config & environment
|
|
69
|
+
.env, .env.example, .env.*, *.yaml, *.yml, *.toml, *.json (config files)
|
|
70
|
+
docker-compose.yml, Dockerfile
|
|
71
|
+
|
|
72
|
+
# API clients & SDKs
|
|
73
|
+
package.json, requirements.txt, Gemfile, go.mod, Cargo.toml (dependencies)
|
|
74
|
+
**/client.*, **/api.*, **/sdk.*, **/service.*
|
|
75
|
+
|
|
76
|
+
# Auth & permissions
|
|
77
|
+
**/*auth*, **/*token*, **/*credential*, **/*oauth*, **/*scope*
|
|
78
|
+
**/*permission*, **/*role*, **/*policy*
|
|
79
|
+
|
|
80
|
+
# Database & storage
|
|
81
|
+
**/*database*, **/*db*, **/*migration*, **/*schema*
|
|
82
|
+
**/*s3*, **/*storage*, **/*bucket*
|
|
83
|
+
|
|
84
|
+
# Integrations
|
|
85
|
+
**/*slack*, **/*webhook*, **/*email*, **/*notification*
|
|
86
|
+
**/*stripe*, **/*payment*, **/*billing*
|
|
87
|
+
|
|
88
|
+
# Claude/AI agent config
|
|
89
|
+
CLAUDE.md, AGENTS.md, .claude/, MCP server configs
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Use `Glob`, `Grep`, and `Read` to find relevant files. Do NOT read `.env` files with real secrets — only `.env.example` or references to env var names.
|
|
93
|
+
|
|
94
|
+
Spawn an **Explore agent** to do a thorough codebase scan for all integration points, API clients, database connections, and external service usage. Tell it to look for the patterns above.
|
|
95
|
+
|
|
96
|
+
## Step 2: Self-Interview
|
|
97
|
+
|
|
98
|
+
Answer each of these 10 questions based ONLY on evidence you found in the codebase. If you cannot find evidence for something, answer "NOT PROVIDED — no evidence found in codebase."
|
|
99
|
+
|
|
100
|
+
**CRITICAL RULES:**
|
|
101
|
+
- ONLY report what you can verify from code, config, or documentation
|
|
102
|
+
- Do NOT guess or infer scopes/permissions that aren't explicitly configured
|
|
103
|
+
- Do NOT hallucinate system connections that aren't in the code
|
|
104
|
+
- "NOT PROVIDED" is always better than a guess
|
|
105
|
+
- If a `.env.example` shows `STRIPE_API_KEY=`, that's evidence of Stripe integration
|
|
106
|
+
- If code imports `@slack/bolt`, that's evidence of Slack integration
|
|
107
|
+
- If there's no evidence of writes, say "No write operations found in codebase"
|
|
108
|
+
|
|
109
|
+
### Questions
|
|
110
|
+
|
|
111
|
+
**Q1 — Deployment Profile**
|
|
112
|
+
1. Project/product name
|
|
113
|
+
2. Owner (team or person) — check package.json, README, CLAUDE.md
|
|
114
|
+
3. What triggers execution (event / schedule / manual / CLI)
|
|
115
|
+
4. One sentence: what this project specifically does
|
|
116
|
+
|
|
117
|
+
**Q2 — Systems Enumeration**
|
|
118
|
+
List every external system this project connects to.
|
|
119
|
+
Format: Name -> API type -> Auth method
|
|
120
|
+
Only list systems with actual code evidence (imports, API calls, config).
|
|
121
|
+
|
|
122
|
+
**Q3 — Permissions Per System**
|
|
123
|
+
For each system, what specific permissions are configured?
|
|
124
|
+
List exact OAuth scopes, API key types, or database roles.
|
|
125
|
+
Do NOT reveal actual secret values.
|
|
126
|
+
|
|
127
|
+
**Q4 — Data Sensitivity**
|
|
128
|
+
For each system, what data do you read?
|
|
129
|
+
Classify each as: PII / financial / credentials / confidential / non-sensitive.
|
|
130
|
+
Give one concrete example of the most sensitive data accessed.
|
|
131
|
+
|
|
132
|
+
**Q5 — Write Operations**
|
|
133
|
+
List every write operation. Format:
|
|
134
|
+
Action -> Target system -> Reversible? -> Approval needed? -> Volume/day
|
|
135
|
+
|
|
136
|
+
**Q6 — Blast Radius**
|
|
137
|
+
For the most dangerous write operation:
|
|
138
|
+
1. How many records/users can it affect? (1 record / 1 user / whole team / whole org)
|
|
139
|
+
2. Worst-case scenario if it goes wrong?
|
|
140
|
+
3. Can it be undone?
|
|
141
|
+
|
|
142
|
+
**Q7 — Frequency and Volume**
|
|
143
|
+
1. How often does this run?
|
|
144
|
+
2. How many API calls per run?
|
|
145
|
+
3. One-at-a-time or batches? What batch size?
|
|
146
|
+
|
|
147
|
+
**Q8 — Excess Permissions**
|
|
148
|
+
Which configured permissions are never actually used in the code?
|
|
149
|
+
What could safely be revoked?
|
|
150
|
+
|
|
151
|
+
**Q9 — Worst Case Failure**
|
|
152
|
+
Worst realistic failure: wrong data to wrong recipient at max scale.
|
|
153
|
+
What goes wrong, who's affected, how bad, can it be recovered?
|
|
154
|
+
|
|
155
|
+
**Q10 — Decision-Making About People**
|
|
156
|
+
Does this project make or influence decisions about people?
|
|
157
|
+
Examples: hiring/screening, scoring creditworthiness, approving insurance, moderating content, granting/denying access, evaluating employees.
|
|
158
|
+
If yes: what kind, who is affected, is a human involved before the final decision?
|
|
159
|
+
|
|
160
|
+
## Step 3: Analyze
|
|
161
|
+
|
|
162
|
+
After answering all 10 questions, analyze the answers:
|
|
163
|
+
|
|
164
|
+
### Risk Assessment
|
|
165
|
+
|
|
166
|
+
For each system, assess:
|
|
167
|
+
- **Per-system risk**: LOW / MEDIUM / HIGH using this rubric:
|
|
168
|
+
- LOW: Read-only, non-sensitive data, single-user scope
|
|
169
|
+
- MEDIUM: Read access to sensitive data OR write to non-sensitive, reversible
|
|
170
|
+
- HIGH: Write to team/org data, or PII/financial access, or irreversible ops, or excessive permissions
|
|
171
|
+
- **Overall risk** = highest individual system risk
|
|
172
|
+
|
|
173
|
+
### Findings
|
|
174
|
+
|
|
175
|
+
Generate findings with IDs (HERON-001, HERON-002, ...) for:
|
|
176
|
+
- Excessive permissions (scopes granted but never used)
|
|
177
|
+
- Sensitive data with broad blast radius
|
|
178
|
+
- Irreversible write operations without safeguards
|
|
179
|
+
- Missing approval workflows for high-impact operations
|
|
180
|
+
- Any other security concerns
|
|
181
|
+
|
|
182
|
+
Each finding needs: severity, title, description, and specific recommendation.
|
|
183
|
+
|
|
184
|
+
### Positive Findings
|
|
185
|
+
|
|
186
|
+
Note what's working well:
|
|
187
|
+
- Reversible write operations
|
|
188
|
+
- Limited blast radius
|
|
189
|
+
- Appropriate permissions
|
|
190
|
+
- No decision-making about people
|
|
191
|
+
- Low frequency reduces risk
|
|
192
|
+
|
|
193
|
+
### Regulatory Flags
|
|
194
|
+
|
|
195
|
+
Based on the evidence, flag regulatory implications for three jurisdictions:
|
|
196
|
+
|
|
197
|
+
**EU (EU AI Act + GDPR)**:
|
|
198
|
+
- Does it process PII? -> GDPR applies
|
|
199
|
+
- Does it make decisions about people? -> Check EU AI Act risk classification
|
|
200
|
+
- Does it hold excessive permissions? -> GDPR Article 25 (data protection by design)
|
|
201
|
+
|
|
202
|
+
**US (SOC 2 + State AI Laws)**:
|
|
203
|
+
- Map to SOC 2 controls: CC1 (governance), CC6 (access), CC7 (monitoring), CC8 (change management)
|
|
204
|
+
- Excessive permissions -> CC6.3 least privilege violation
|
|
205
|
+
- Org-wide blast radius + writes -> CC7.2 / CC8.1
|
|
206
|
+
|
|
207
|
+
**UK (UK GDPR + ICO)**:
|
|
208
|
+
- Same as GDPR but reference UK GDPR / DPA 2018
|
|
209
|
+
- ICO AI Risk Toolkit recommendations
|
|
210
|
+
|
|
211
|
+
### Verdict
|
|
212
|
+
|
|
213
|
+
Choose one:
|
|
214
|
+
- **APPROVE** — minimal access, appropriate for stated purpose
|
|
215
|
+
- **APPROVE WITH CONDITIONS** — acceptable but improvements needed
|
|
216
|
+
- **DENY** — excessive access, unacceptable risk without remediation
|
|
217
|
+
|
|
218
|
+
## Step 4: Generate Report
|
|
219
|
+
|
|
220
|
+
Create the report and save it to `reports/heron-audit-YYYY-MM-DD.md`:
|
|
221
|
+
|
|
222
|
+
The report must include these sections in this order:
|
|
223
|
+
|
|
224
|
+
1. **Header** — Generated date, project name, risk level, data quality score, regulatory summary
|
|
225
|
+
2. **Scope & Methodology** — Assessment type, method, duration, limitations
|
|
226
|
+
3. **Executive Summary** — Dashboard table (Risk | Systems | Findings) + 2-3 sentence summary
|
|
227
|
+
4. **Agent Profile** — Purpose, trigger, owner, frequency
|
|
228
|
+
5. **Findings** — Table with ID, Severity, Finding, Description, Recommendation columns
|
|
229
|
+
6. **Systems & Access** — Per-system cards with risk rating, scopes, data, blast radius, writes
|
|
230
|
+
7. **What's Working Well** — Positive findings with checkmarks
|
|
231
|
+
8. **Verdict & Recommendations** — Decision + numbered recommendations + permissions delta
|
|
232
|
+
9. **Regulatory Compliance** — EU, US, UK sub-sections with specific flags
|
|
233
|
+
10. **Data Quality** — Field-by-field coverage table (7 compliance fields)
|
|
234
|
+
11. **Evidence Sources** — List of files analyzed (in collapsible details)
|
|
235
|
+
|
|
236
|
+
Footer: *This report was generated automatically by [Heron](https://github.com/theonaai/Heron), an open-source AI agent auditor.*
|
|
237
|
+
|
|
238
|
+
## Important Notes
|
|
239
|
+
|
|
240
|
+
- Create the `reports/` directory if it doesn't exist
|
|
241
|
+
- Use today's date in the filename
|
|
242
|
+
- If a report already exists for today, append a number: `heron-audit-YYYY-MM-DD-2.md`
|
|
243
|
+
- After saving, tell the user where the report is and give a brief summary of findings
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# heron-update-check — check for newer versions of Heron
|
|
3
|
+
# Outputs: UPGRADE_AVAILABLE <local> <remote> | JUST_UPGRADED <from> <to> | (nothing)
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
# ── Paths ────────────────────────────────────────────────────────────────────
|
|
7
|
+
HERON_DIR=""
|
|
8
|
+
STATE_DIR="$HOME/.heron"
|
|
9
|
+
CACHE_FILE="$STATE_DIR/last-update-check"
|
|
10
|
+
MARKER_FILE="$STATE_DIR/just-upgraded-from"
|
|
11
|
+
|
|
12
|
+
# Find the Heron repo root — resolve symlinks first
|
|
13
|
+
SCRIPT_PATH="$0"
|
|
14
|
+
# Follow symlinks to get the real path
|
|
15
|
+
if command -v readlink >/dev/null 2>&1; then
|
|
16
|
+
REAL_PATH="$(readlink -f "$SCRIPT_PATH" 2>/dev/null || readlink "$SCRIPT_PATH" 2>/dev/null || echo "$SCRIPT_PATH")"
|
|
17
|
+
else
|
|
18
|
+
REAL_PATH="$SCRIPT_PATH"
|
|
19
|
+
fi
|
|
20
|
+
SCRIPT_DIR="$(cd "$(dirname "$REAL_PATH")" && pwd)"
|
|
21
|
+
|
|
22
|
+
# Script is in skills/heron-audit/bin/ → repo root is ../../..
|
|
23
|
+
if [ -f "$SCRIPT_DIR/../../../VERSION" ]; then
|
|
24
|
+
HERON_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Can't find repo — skip silently
|
|
28
|
+
[ -z "$HERON_DIR" ] && exit 0
|
|
29
|
+
|
|
30
|
+
LOCAL_VERSION=""
|
|
31
|
+
[ -f "$HERON_DIR/VERSION" ] && LOCAL_VERSION=$(cat "$HERON_DIR/VERSION" | tr -d '[:space:]')
|
|
32
|
+
[ -z "$LOCAL_VERSION" ] && exit 0
|
|
33
|
+
|
|
34
|
+
mkdir -p "$STATE_DIR"
|
|
35
|
+
|
|
36
|
+
# ── Step 0: Check if updates disabled ───────────────────────────────────────
|
|
37
|
+
if [ -f "$STATE_DIR/config" ] && grep -q "update_check=false" "$STATE_DIR/config" 2>/dev/null; then
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# ── Step 1: Check "just upgraded" marker ────────────────────────────────────
|
|
42
|
+
if [ -f "$MARKER_FILE" ]; then
|
|
43
|
+
OLD_VERSION=$(cat "$MARKER_FILE" | tr -d '[:space:]')
|
|
44
|
+
rm -f "$MARKER_FILE"
|
|
45
|
+
echo "JUST_UPGRADED $OLD_VERSION $LOCAL_VERSION"
|
|
46
|
+
exit 0
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# ── Step 2: Check cache (60-min TTL) ────────────────────────────────────────
|
|
50
|
+
if [ -f "$CACHE_FILE" ]; then
|
|
51
|
+
CACHE_AGE=$(( $(date +%s) - $(stat -f%m "$CACHE_FILE" 2>/dev/null || stat -c%Y "$CACHE_FILE" 2>/dev/null || echo 0) ))
|
|
52
|
+
CACHED_RESULT=$(cat "$CACHE_FILE" 2>/dev/null || true)
|
|
53
|
+
|
|
54
|
+
if [ "$CACHE_AGE" -lt 3600 ]; then
|
|
55
|
+
# Cache is fresh
|
|
56
|
+
if echo "$CACHED_RESULT" | grep -q "^UPGRADE_AVAILABLE"; then
|
|
57
|
+
echo "$CACHED_RESULT"
|
|
58
|
+
fi
|
|
59
|
+
exit 0
|
|
60
|
+
fi
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# ── Step 3: Fetch remote VERSION from GitHub ────────────────────────────────
|
|
64
|
+
REMOTE_VERSION=$(curl -sf --max-time 5 "https://raw.githubusercontent.com/theonaai/Heron/main/VERSION" 2>/dev/null | tr -d '[:space:]' || true)
|
|
65
|
+
|
|
66
|
+
# Network error — assume up to date
|
|
67
|
+
if [ -z "$REMOTE_VERSION" ]; then
|
|
68
|
+
echo "UP_TO_DATE" > "$CACHE_FILE"
|
|
69
|
+
exit 0
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
# ── Step 4: Compare ─────────────────────────────────────────────────────────
|
|
73
|
+
if [ "$LOCAL_VERSION" = "$REMOTE_VERSION" ]; then
|
|
74
|
+
echo "UP_TO_DATE" > "$CACHE_FILE"
|
|
75
|
+
exit 0
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# Versions differ — upgrade available
|
|
79
|
+
RESULT="UPGRADE_AVAILABLE $LOCAL_VERSION $REMOTE_VERSION"
|
|
80
|
+
echo "$RESULT" > "$CACHE_FILE"
|
|
81
|
+
echo "$RESULT"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Install the /heron-audit skill for Claude Code
|
|
3
|
+
#
|
|
4
|
+
# Usage (from the repo root):
|
|
5
|
+
# cd Heron && bash skills/heron-audit/install.sh
|
|
6
|
+
#
|
|
7
|
+
# Or install via npx (no clone needed):
|
|
8
|
+
# npx heron-ai install-skill
|
|
9
|
+
|
|
10
|
+
set -e
|
|
11
|
+
|
|
12
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
13
|
+
SKILL_DIR="$HOME/.claude/skills/heron-audit"
|
|
14
|
+
|
|
15
|
+
echo "Installing /heron-audit skill for Claude Code..."
|
|
16
|
+
|
|
17
|
+
mkdir -p "$SKILL_DIR/bin"
|
|
18
|
+
mkdir -p "$HOME/.heron"
|
|
19
|
+
|
|
20
|
+
# Symlink SKILL.md so updates to the repo automatically apply
|
|
21
|
+
ln -sf "$SCRIPT_DIR/SKILL.md" "$SKILL_DIR/SKILL.md"
|
|
22
|
+
|
|
23
|
+
# Symlink update checker
|
|
24
|
+
ln -sf "$SCRIPT_DIR/bin/heron-update-check" "$SKILL_DIR/bin/heron-update-check"
|
|
25
|
+
|
|
26
|
+
echo "Installed: $SKILL_DIR/SKILL.md -> $SCRIPT_DIR/SKILL.md"
|
|
27
|
+
echo "Installed: $SKILL_DIR/bin/heron-update-check -> $SCRIPT_DIR/bin/heron-update-check"
|
|
28
|
+
echo ""
|
|
29
|
+
echo "Usage: Type /heron-audit in any Claude Code session to run an access audit."
|