@akasecurity/ai-tc-antigravity 0.9.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/LICENSE +201 -0
- package/hooks.json +50 -0
- package/package.json +44 -0
- package/plugin.json +14 -0
- package/scripts/apply-suppressions.js +29689 -0
- package/scripts/backfill.js +30691 -0
- package/scripts/dashboard.js +46 -0
- package/scripts/filescan.js +31353 -0
- package/scripts/firstrun.js +28892 -0
- package/scripts/intro.js +18614 -0
- package/scripts/onboard.js +26577 -0
- package/scripts/post-tool-use.js +18743 -0
- package/scripts/pre-invocation.js +30069 -0
- package/scripts/pre-tool-use.js +30065 -0
- package/scripts/query.js +29168 -0
- package/scripts/reconcile.js +29320 -0
- package/scripts/remediate.js +30607 -0
- package/scripts/scan-worker.js +18006 -0
- package/scripts/start-light.js +18756 -0
- package/scripts/stop.js +18743 -0
- package/scripts/triage-rubric.md +93 -0
- package/skills/audit/SKILL.md +20 -0
- package/skills/dashboard/SKILL.md +27 -0
- package/skills/detections/SKILL.md +31 -0
- package/skills/exceptions/SKILL.md +27 -0
- package/skills/findings/SKILL.md +24 -0
- package/skills/health/SKILL.md +21 -0
- package/skills/recommend/SKILL.md +22 -0
- package/skills/scan/SKILL.md +70 -0
- package/skills/setup/SKILL.md +928 -0
- package/skills/tokens/SKILL.md +24 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# AKA setup-wizard triage prompt (draft — validation harness artifact)
|
|
2
|
+
|
|
3
|
+
You are the AKA Security setup wizard's inline triage step. You have just
|
|
4
|
+
scanned a workspace (working tree and/or history) and detected a set of raw
|
|
5
|
+
hits — matches from AKA's deterministic regex detection rules, shown to you
|
|
6
|
+
with their real (unmasked) value (`rawMatch`) and a surrounding context window
|
|
7
|
+
that has itself been masked for any other secrets, so you can judge each hit by
|
|
8
|
+
its own value. This is a one-time, transient look: the raw values are **never
|
|
9
|
+
persisted** — only your verdicts are written, as neutral exceptions and
|
|
10
|
+
per-category policies.
|
|
11
|
+
|
|
12
|
+
You will receive the hits below as a JSONL block, one `TriageHit` object per
|
|
13
|
+
line:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
{"id":"...","ruleId":"...","category":"...","severity":"...","maskedMatch":"...","rawMatch":"...","context":"...","confidence":0.9}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Step 1 — Silently filter false positives
|
|
20
|
+
|
|
21
|
+
Deterministic regex rules produce false positives as an expected cost —
|
|
22
|
+
placeholders, documentation examples, canonical fake values (`AKIAIOSFODNN7EXAMPLE`,
|
|
23
|
+
`123-45-6789`, `xxxx-xxxx-xxxx-xxxx`), and similar. Recognizing these is normal,
|
|
24
|
+
routine work, not a failure of the rules or the codebase — do **not** frame it
|
|
25
|
+
negatively (no "sloppy", "bad practice", or similar) in your reasoning or notes.
|
|
26
|
+
Silently drop what is clearly a false positive from your risk assessment; only
|
|
27
|
+
carry genuine hits forward as evidence of real exposure. Still count both —
|
|
28
|
+
your recommendation records `genuineCount` and `fpCount` per category so a
|
|
29
|
+
human reviewer can see the split.
|
|
30
|
+
|
|
31
|
+
## Step 2 — Calibrate a recommendation per category
|
|
32
|
+
|
|
33
|
+
For each category present in the hits, choose exactly one action, biased
|
|
34
|
+
toward the **least-restrictive action that still covers the real risk**:
|
|
35
|
+
|
|
36
|
+
| Action | Meaning |
|
|
37
|
+
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
38
|
+
| `monitor` | Log only; nothing is blocked, warned, or altered. Right for FP-only or low-value audit-trail categories. |
|
|
39
|
+
| `warn` | Flag the request and let the user decide; nothing is modified automatically. The common, safe default for genuine-but-low/medium-severity evidence, or a high-FP class that still needs a human look. |
|
|
40
|
+
| `redact` | Replace the value with a safe placeholder before it leaves the machine — but **only in tool I/O** (file writes, bash, etc.). **`redact` is a no-op for the prompt/conversation channel** — a secret typed or pasted directly into the chat still reaches the model unredacted. Choose `redact` only when the exposure risk is specifically tool-I/O-shaped and prompt leakage is not the concern. |
|
|
41
|
+
| `block` | Refuse the action outright. Reserve for clear, high-severity, high-confidence genuine leaks — especially ones with a plausible prompt vector, since `redact` cannot cover that channel. |
|
|
42
|
+
|
|
43
|
+
Guidance:
|
|
44
|
+
|
|
45
|
+
- All-FP or irrelevant evidence (or low-value audit-trail signal, e.g. bare
|
|
46
|
+
`code_context` paths) → `monitor`.
|
|
47
|
+
- Genuine hits at low/medium severity, or a category with heavy FP density
|
|
48
|
+
that still deserves a human glance → `warn`. This is the expected common
|
|
49
|
+
outcome on a well-behaved corpus — recommending `warn` across the board is a
|
|
50
|
+
good, safe result, not under-protection.
|
|
51
|
+
- Genuine sensitive values that mainly travel through tool I/O (not the
|
|
52
|
+
prompt/conversation) → `redact`.
|
|
53
|
+
- Clear, high-severity, high-confidence genuine leaks, especially ones that
|
|
54
|
+
could reach the model via the prompt itself (where `redact` is a no-op) →
|
|
55
|
+
`block`.
|
|
56
|
+
|
|
57
|
+
## Output
|
|
58
|
+
|
|
59
|
+
Respond with your reasoning if you like, but end your reply with **exactly
|
|
60
|
+
one** fenced JSON block containing a `TriageRecommendation`:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"perCategory": [
|
|
65
|
+
{
|
|
66
|
+
"category": "secret",
|
|
67
|
+
"action": "block",
|
|
68
|
+
"reasoning": "one or two sentences, no negative framing of the FPs",
|
|
69
|
+
"genuineCount": 2,
|
|
70
|
+
"fpCount": 2,
|
|
71
|
+
"fpIds": ["3", "17"]
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"notes": ""
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- Emit one `perCategory` entry for every category that appears in the input
|
|
79
|
+
hits (do not invent categories that were not present).
|
|
80
|
+
- `action` must be exactly one of `monitor`, `warn`, `redact`, `block`.
|
|
81
|
+
- `genuineCount` and `fpCount` are your counts of genuine vs. false-positive
|
|
82
|
+
hits you identified within that category (both required, both ≥ 0).
|
|
83
|
+
- `fpIds` (required) lists the `id` of every hit in that category you judged a
|
|
84
|
+
false positive. **Copy each `id` verbatim from the hit you are describing** —
|
|
85
|
+
they are stable identifiers assigned by the scanner, not positions in the
|
|
86
|
+
input. Do not renumber them, do not start from 1, and never emit an `id` that
|
|
87
|
+
is not present in the hits you were given: ids you were not shown belong to
|
|
88
|
+
other hits, and naming one would silence a detection you never examined.
|
|
89
|
+
`fpCount` must equal `fpIds.length`.
|
|
90
|
+
- `notes` is optional free text (empty string if nothing to add) for anything
|
|
91
|
+
that doesn't fit a single category — e.g. cross-category observations.
|
|
92
|
+
- The fenced ```json block must be the last thing in your reply and must
|
|
93
|
+
contain nothing but that one JSON object.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aka-audit
|
|
3
|
+
description: Show AKA's recent enforcement decisions
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AKA audit
|
|
7
|
+
|
|
8
|
+
Run the read script and show the user its output **exactly as printed**. The
|
|
9
|
+
script already prints its content inside a Markdown code fence — reproduce that
|
|
10
|
+
verbatim and do **not** add another code fence, strip the fence, or reformat it.
|
|
11
|
+
The fence is required: it is a space-aligned monospace table that Markdown would
|
|
12
|
+
otherwise collapse. Do not reformat or re-narrate the rows.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
node "${PLUGIN_ROOT}/scripts/query.js" audit
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This is the decision log: the most recent detections from `~/.aka/data/aka.db`
|
|
19
|
+
with the action AKA took (block / redact / warn / allow), the rule, and where it
|
|
20
|
+
fired (source tool + event kind). It is read-only.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aka-dashboard
|
|
3
|
+
description: Launch the AKA web dashboard in your browser (reads your local store)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AKA dashboard
|
|
7
|
+
|
|
8
|
+
Launch the AKA web dashboard and relay the short status the script prints **as-is**.
|
|
9
|
+
The command returns immediately: it starts the dashboard server in the background
|
|
10
|
+
and it opens in the browser once ready, so a lack of further output is **not** an
|
|
11
|
+
error — do not wait on it or re-run it. If the script prints install guidance (the
|
|
12
|
+
`aka` CLI isn't installed), relay that verbatim.
|
|
13
|
+
|
|
14
|
+
If the user asked for a specific port, pass `--port <N>` through unchanged;
|
|
15
|
+
otherwise run it with no arguments.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
node "${PLUGIN_ROOT}/scripts/dashboard.js" [--port <N>]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This mirrors the `aka dashboard` CLI command: it serves the OSS web-ui against
|
|
22
|
+
your local store at `~/.aka/data` (no backend) and opens
|
|
23
|
+
`http://localhost:4319/security`. The web server is bundled in the
|
|
24
|
+
`@akasecurity/cli` package — the plugin ships no server of its own — so the
|
|
25
|
+
launcher delegates to the `aka` CLI and, if it isn't installed, prints how to get
|
|
26
|
+
it. For the terminal-only read surfaces, use the aka-health, aka-findings,
|
|
27
|
+
aka-recommend, aka-audit, or aka-tokens skills instead.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aka-detections
|
|
3
|
+
description: List installed AKA detection packs, versions, and available updates
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AKA detections
|
|
7
|
+
|
|
8
|
+
Run the read script and show the user its output **exactly as printed**. The
|
|
9
|
+
script already prints its content inside a Markdown code fence — reproduce that
|
|
10
|
+
verbatim and do **not** add another code fence, strip the fence, or reformat it.
|
|
11
|
+
The fence is required: it is a space-aligned monospace table that Markdown would
|
|
12
|
+
otherwise collapse. Do not reformat the columns or restate each row.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
node "${PLUGIN_ROOT}/scripts/query.js" detections
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This lists the detection packs installed in `~/.aka/data/aka.db` — one row per
|
|
19
|
+
pack with its installed version, the latest version this plugin ships, rule
|
|
20
|
+
count, enabled state, assigned enforcement policy, and whether an update is
|
|
21
|
+
available. These packs are what the plugin actually scans with.
|
|
22
|
+
|
|
23
|
+
Detection updates are **never applied automatically** — a plugin upgrade only
|
|
24
|
+
records what's newly available; the installed packs keep running unchanged
|
|
25
|
+
until the user updates them. This skill is strictly **read-only**: do not
|
|
26
|
+
apply, enable, disable, or re-policy a detection from here. If the user wants
|
|
27
|
+
to update, tell them to run one of these themselves in a terminal:
|
|
28
|
+
|
|
29
|
+
- `aka detections update --all` — update every pack
|
|
30
|
+
- `aka detections update <pack-id>` — update one pack
|
|
31
|
+
- `aka dashboard` → Detections → **Update** — review and apply in the dashboard
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aka-exceptions
|
|
3
|
+
description: List active AKA detection exceptions (masked) from the local store
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AKA exceptions
|
|
7
|
+
|
|
8
|
+
Run the read script and show the user its output **exactly as printed**. The
|
|
9
|
+
script already prints its content inside a Markdown code fence — reproduce that
|
|
10
|
+
verbatim and do **not** add another code fence, strip the fence, or reformat it.
|
|
11
|
+
The fence is required: it is a space-aligned monospace table that Markdown would
|
|
12
|
+
otherwise collapse. Do not reformat the columns or restate each row.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
node "${PLUGIN_ROOT}/scripts/query.js" exceptions
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This lists the **active** detection exceptions from `~/.aka/data/aka.db` — the
|
|
19
|
+
masked value, rule, scope, relative expiry, use count, and who granted it. The
|
|
20
|
+
approved value is never stored, only a keyed fingerprint and a masked preview.
|
|
21
|
+
|
|
22
|
+
This skill is strictly **read-only**. Do not offer to create, approve, or
|
|
23
|
+
revoke an exception from here — creation and revocation happen only in a
|
|
24
|
+
terminal, out-of-band, via the `aka` CLI (`aka exception approve`,
|
|
25
|
+
`aka exception revoke <id>`; see `aka exception --help`). If the user asks you
|
|
26
|
+
to grant or revoke one, tell them to run those commands themselves in a
|
|
27
|
+
terminal instead.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aka-findings
|
|
3
|
+
description: List recent AKA findings (masked) from the local store
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AKA findings
|
|
7
|
+
|
|
8
|
+
Run the read script and show the user its output **exactly as printed**. The
|
|
9
|
+
script already prints its content inside a Markdown code fence — reproduce that
|
|
10
|
+
verbatim and do **not** add another code fence, strip the fence, or reformat it.
|
|
11
|
+
The fence is required: it is a space-aligned monospace table that Markdown would
|
|
12
|
+
otherwise collapse. Do not reformat the columns or restate each row.
|
|
13
|
+
|
|
14
|
+
If the user asked to filter by severity — e.g. `--critical`, `--high`,
|
|
15
|
+
`--medium`, `--low`, or `--severity <level>` — pass that flag through to the
|
|
16
|
+
script unchanged. Otherwise run it with no flag.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
node "${PLUGIN_ROOT}/scripts/query.js" findings [--severity <critical|high|medium|low>]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This lists the most recent findings from `~/.aka/data/aka.db` with their rule,
|
|
23
|
+
category, severity, action taken, and the **masked** match (raw secrets are
|
|
24
|
+
never stored), narrowed to one severity when a filter is given. It is read-only.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aka-health
|
|
3
|
+
description: Show AKA detection activity and local security posture
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AKA health
|
|
7
|
+
|
|
8
|
+
Run the read script and show the user its output **exactly as printed**. The
|
|
9
|
+
script already prints its content inside a Markdown code fence — reproduce that
|
|
10
|
+
verbatim and do **not** add another code fence, strip the fence, or reformat it.
|
|
11
|
+
The fence is required: it is space-aligned monospace (gauges, bars, a 7-day chart)
|
|
12
|
+
that Markdown would otherwise collapse. Do not reformat or summarize the table;
|
|
13
|
+
you may add at most one short sentence of context after it.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
node "${PLUGIN_ROOT}/scripts/query.js" health
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This reads the local store at `~/.aka/data/aka.db` (detection activity, action
|
|
20
|
+
breakdown, category coverage, last 7 days). It is read-only. If the store is
|
|
21
|
+
empty, the script says so — relay that as-is; nothing is wrong.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aka-recommend
|
|
3
|
+
description: Surface AKA's top recommendations from recent findings
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AKA recommend
|
|
7
|
+
|
|
8
|
+
Run the read script and show the user its output **exactly as printed**. The
|
|
9
|
+
script already prints its content inside a Markdown code fence — reproduce that
|
|
10
|
+
verbatim and do **not** add another code fence, strip the fence, or reformat it.
|
|
11
|
+
The fence is required: the output is space-aligned monospace whose lines start
|
|
12
|
+
with characters like `1.` and `●`; shown unfenced, Markdown collapses the
|
|
13
|
+
indentation and turns those into auto-numbered lists and bullets. You may expand
|
|
14
|
+
on the suggested next steps if the user asks, but lead with the output as-is.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
node "${PLUGIN_ROOT}/scripts/query.js" recommend
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This groups recent findings by category (ranked by severity, then frequency) and
|
|
21
|
+
prints a plain-language next step for each. It is read-only over
|
|
22
|
+
`~/.aka/data/aka.db`.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aka-scan
|
|
3
|
+
description: Scan working-tree source files for code security flaws
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AKA scan
|
|
7
|
+
|
|
8
|
+
## Single-repo scan (default)
|
|
9
|
+
|
|
10
|
+
Run the worktree scan script and show the user its output **exactly as printed**.
|
|
11
|
+
The script already prints its content inside a Markdown code fence — reproduce
|
|
12
|
+
that verbatim and do **not** add another code fence, strip the fence, or reformat it.
|
|
13
|
+
The fence is required: it is space-aligned monospace that Markdown would otherwise
|
|
14
|
+
collapse.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
node "${PLUGIN_ROOT}/scripts/filescan.js" --dir "${PWD}"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This scans all source files (`.ts`, `.js`, `.py`, `.java`, `.rb`, `.cs`, `.go`,
|
|
21
|
+
`.rs`, `.php`, and more) under the current project directory for insecure code
|
|
22
|
+
patterns — SQL injection, command injection, XSS, insecure deserialization, weak
|
|
23
|
+
cryptography, hardcoded credentials, dev-mode configuration leaks, and other
|
|
24
|
+
OWASP Top 10 issues.
|
|
25
|
+
|
|
26
|
+
Results are recorded to the local store (`~/.aka/data/aka.db`) and are visible
|
|
27
|
+
via the aka-findings skill. Re-running this scan is safe — files whose content
|
|
28
|
+
has already been recorded are skipped.
|
|
29
|
+
|
|
30
|
+
Files excluded by the repo's `.gitignore` are **still scanned** — local scratch
|
|
31
|
+
and generated files are a common place for real secrets to hide — but their
|
|
32
|
+
findings are marked as coming from gitignored content and reported as
|
|
33
|
+
informational in the summary.
|
|
34
|
+
|
|
35
|
+
To exclude paths from scanning entirely, add a `.akaignore` file (gitignore
|
|
36
|
+
syntax, any directory level). Unlike `.gitignore`, `.akaignore` is a **hard
|
|
37
|
+
skip**: matching files are never read and produce no findings. A negation also
|
|
38
|
+
re-includes a directory the scanner skips by default — e.g. `!vendor/` scans
|
|
39
|
+
first-party code living under `vendor/`.
|
|
40
|
+
|
|
41
|
+
## Multi-repo scan (opt-in)
|
|
42
|
+
|
|
43
|
+
To scan **all git repositories** found under the current directory (up to 4
|
|
44
|
+
directory levels deep), use the `--discover` flag:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node "${PLUGIN_ROOT}/scripts/filescan.js" --discover
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To search from a different directory, pass `--root` (and optionally `--depth`):
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
node "${PLUGIN_ROOT}/scripts/filescan.js" --discover --root ~/projects --depth 3
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Discovery walks the filesystem from the search root looking for `.git`
|
|
57
|
+
directories. It skips large system directories (`Library`, `node_modules`, etc.)
|
|
58
|
+
and stops recursing once a repo root is found (submodules are not separately
|
|
59
|
+
enumerated). The output shows a per-repository breakdown in addition to the
|
|
60
|
+
aggregate totals.
|
|
61
|
+
|
|
62
|
+
**Scope confirmation:** `--discover` never sweeps the home directory implicitly —
|
|
63
|
+
the default root is the current directory. Before passing a `--root` outside the
|
|
64
|
+
current project (especially `--root ~`, the whole-machine sweep), tell the user
|
|
65
|
+
what will be read and ask for explicit confirmation. Do not assume consent from
|
|
66
|
+
a generic "scan everything" phrasing without naming the scope.
|
|
67
|
+
|
|
68
|
+
Deduplication is global across all repos in a single `--discover` run — a file
|
|
69
|
+
whose content hash is already recorded (from a previous scan or a live hook
|
|
70
|
+
capture) is skipped regardless of which repo it lives in.
|