@mnaimfaizy/agent-kit 1.0.0-beta.10 → 1.0.0-beta.12
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 +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,6 @@ npx @mnaimfaizy/agent-kit deep-scan --verify findings.md --ref fix/x # Verifica
|
|
|
22
22
|
- `deep-scan` is the launcher for a Deep scan. First it reads the Scan recipe (`.security/scan-recipe.yml`, or `--recipe <path>` relative to the repository root) as committed on the default branch (origin's HEAD, else `main`, or `--default-branch <b>`), never from the working tree, and validates it. With no recipe or an invalid one it refuses, lists every problem with its field, points to [the recipe format](../docs/security-audit.md#scan-recipe), and exits 1; it never falls back to a `full` audit. Then the pre-flight refusals: it refuses, exit 1, when `GH_TOKEN` or `GITHUB_TOKEN` is set in its environment, or when the default branch has a committed `.env` (or `.env.<name>`, templates aside) that the copy-in would forward wholesale. It also refuses, exit 1, when the default branch has no security-audit `DEEP.md` or no Threat pack, or when it has no model credential: an Anthropic API key from `ANTHROPIC_API_KEY`, or with `--credential-from env:<NAME>` another variable, or `--credential-from op://<vault>/<item>/<field>` 1Password through `op read` (see [Credentials](../docs/security-audit.md#credentials)). `--credential-from` never takes the key itself (a usage error, exit 2, that never prints it), and the key never reaches any command the launcher runs. With `--credential subscription` it runs instead on a Claude subscription token (from `claude setup-token`; read from `CLAUDE_CODE_OAUTH_TOKEN` by default, or `--credential-from` as for a key), an opt-in at your own risk: it relies on undocumented behaviour and may break with any Claude Code release, has no refresh, so you rotate the token by hand, leaves the terms question to you, and the proxy's token cap is the only spend lever. On that path the sandbox holds a placeholder `CLAUDE_CODE_OAUTH_TOKEN`, Claude Code runs without `--bare` (so it discovers the scanned repository's `CLAUDE.md` and skills, which the brief marks as content, not instructions) and with `--strict-mcp-config`, and the proxy swaps only the `Authorization: Bearer` value, never sending `x-api-key`. A subscription token without `--credential subscription`, or anything but one with it, is refused, exit 1, without printing it ([the subscription path](../docs/security-audit.md#the-subscription-path-opt-in)). Then it chooses a [sandbox runtime](../docs/security-audit.md#sandbox-runtimes) from the host, in this order: Docker Sandboxes (`sbx`), Kata Containers or Firecracker on Linux, gVisor (`runsc`) on Linux, the last two on Docker Engine 28.0 or later; a Mac uses Docker Sandboxes. It refuses, exit 1, plain Docker on Linux, Docker Engine older than 28.0 (naming the version found and the minimum), Docker Desktop on Windows with WSL 2, Docker Desktop on macOS (naming Docker Sandboxes), and anything else, naming the accepted runtimes and the CI path; there is no override flag. Those checks run only read-only `git` commands and read-only probes of the runtimes' CLIs (`sbx version`, `docker info`, `<cli> --version`). Then it runs [the sandbox](../docs/security-audit.md#what-goes-into-and-out-of-the-sandbox) on the chosen runtime, through `docker`: it pulls the recipe's image (or builds its Dockerfile from the default branch) and layers a pinned Claude Code with the auto-updater off; starts the sandbox with no mount; copies in a `git archive` of the default branch's tip and the recipe's grounding; runs `setup`, `start`, `ready` and `seed` with egress only to the recipe's `registries`, through a proxy it runs on the host (a failing step ends the run, exit 1, with its output); cuts setup's egress (stops its proxy and removes its relay) and checks from the host that nothing is left to reach; opens the model route, a key-injecting proxy on the host that forwards only to the model API and swaps the sandbox's placeholder key for the real one, through its own relay, and checks from the host that the sandbox reaches that relay alone; runs the real Claude Code with `--bare`, a placeholder `ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL` pinned by its own `--settings` (project settings are not loaded) and no web tools, handing it the deep procedure, the Threat pack and the recipe; copies out the one report file to a new private folder and prints its path (nothing is filed or posted); and removes the sandbox, relays, probes, networks and images on every exit path, Ctrl+C and `SIGTERM` included (exit 130 or 143). It exits 0 when the report came out. On Docker Engine the sandbox has one network, attached at `docker run` and never connected or disconnected after (a running gVisor sandbox would not see it), `--internal` and in Docker's `isolated` gateway mode, so the host has no address on it; it reaches each proxy only through a relay container on it, built on stdin from an official `node` image pinned by digest and a digest-checked Node-core script, which forwards the proxy's one port. The host checks the network's mode and that the sandbox is on it alone, and a probe container, run under the sandbox's own runtime, checks the routes before the target starts, after the cut and before the agent step. Copy-in unpacks with the sandbox's own `tar`, so a hostile setup step could alter the brief on its way in; the target already controls the sandbox. Every run is bounded by [limits](../docs/security-audit.md#limits), all enforced outside the sandbox and never set by the recipe: a setup wall clock (`--setup-minutes <n>`, default 20), a scan wall clock (`--scan-minutes <n>`, default 60), Claude Code's turn limit (`--max-turns <n>`, default 200) and the model proxy's token cap for the run (`--max-tokens <n>`, default 5000000, counting input, output and cache tokens from the model API's `usage`). A value that is not a positive number is a usage error, exit 2. A limit that fires stops the running step, copies out the report so far with a `Stopped: wall clock | turns | tokens` line added after `Finding count`, tears down and exits 3; with no report, it writes nothing and prints only `Stopped:` and the limit's name. On Docker Sandboxes it does the same through `sbx`: it first refuses, exit 1, unless your global sbx network policy is deny-all (read with `sbx policy ls --json`, never changed), builds its template with Docker on the host (Docker Desktop on Windows): it pulls the recipe's `image`, layers the pinned Claude Code and a non-root `agent` user (uid 1000, home `/home/agent`, the image's `USER`) on it, as Docker's docs require of a template, after checking it has curl, git, CA certificates and bash (sbx starts only an sbx-ready image), and loads it with `sbx template load` (a `dockerfile` is refused); then it creates the sandbox mountless from that template, opens setup egress with per-sandbox `sbx policy` rules that it removes for the cut; the model route is one more per-sandbox rule, for the model proxy alone (`host.docker.internal:<port>` from the sandbox, which sbx's policy names `localhost:<port>`), and teardown also removes the template and the layered image. Its process allowlist is `git`, `sbx`, `docker`, `runsc`, `kata-runtime`, `firecracker` and the 1Password CLI `op`; `init`, `upgrade` and `doctor` still run only `git` and `gh`. `doctor` reports whether the recipe is at its default path and valid. `--model <id>` names the model the agent runs on (a plain id; Claude Code's default without it), `--effort <level>` its effort level (`low`, `medium`, `high`, `xhigh` or `max`, passed to Claude Code as `--effort`; Claude Code's default without it, and anything else is a usage error, exit 2), the `Agent step:` line names the model and effort asked for, the `Model proxy:` line names the model id the API answered with, `--report <path>` writes the report to that new file in a folder that exists, and in GitHub Actions (`GITHUB_ACTIONS=true`) `deep-scan` keeps the Public-log rule, printing none of Claude Code's error output, the model proxy's refusals and answers (the answered model ids included), or copy-out error detail (see [Deep scan in CI](../docs/security-audit.md#deep-scan-in-ci)).
|
|
23
23
|
- `deep-scan --verify <file> --ref <ref>` is a [Verification run](../docs/security-audit.md#verification-run): it re-attempts the Reproduction of the findings in `<file>` (each a `###` section with `- **Concept id:**`, `- **Location:**` and `- **Observation:**`, as a deep report gives them) on `<ref>`, a local branch, tag or commit such as your fix branch, exported as committed, never the working tree. The recipe, the skill and the Threat pack still come from the default branch. It is confirm-only (no `full` walk, no exploration, no new findings): the agent gets the Verification-run procedure, not the full deep procedure, and the finding file goes in with its brief after the network cut. Its defaults are scan 15 min, 50 turns and the same token cap. Each flag needs the other, and `--report` is not taken with them (usage errors, exit 2). A finding file that is missing, unreadable or out of shape, or a ref that is not a local commit, is refused, exit 1, before any runtime starts. The report goes only to a new private folder; `deep-scan` prints each finding's `Reproduced: yes` (the fix does not hold) or `no` (it holds), exits 1 if the report misses one, and files or posts nothing. It is local only: refused, exit 1, in GitHub Actions (`GITHUB_ACTIONS=true`).
|
|
24
24
|
|
|
25
|
-
The package version matches the Agent-kit Release line: `@mnaimfaizy/agent-kit@1.0.0-beta.
|
|
25
|
+
The package version matches the Agent-kit Release line: `@mnaimfaizy/agent-kit@1.0.0-beta.12` is published from tag `v1.0.0-beta.12`, with npm provenance.
|
|
26
26
|
|
|
27
27
|
Full documentation: [Getting started](https://github.com/mnaimfaizy/agent-kit/blob/main/docs/getting-started.md) and [Adopt](https://github.com/mnaimfaizy/agent-kit/blob/main/docs/adopt.md#check-an-adoption-with-doctor).
|
package/package.json
CHANGED