Bring up a test target the user owns and prepare it for an authorized cxg run, under bravos's governance: loopback by default, a committed and reviewed scope.yaml, the human's own typed authorization, and a real session captured or imported, never invented. Use before bravos-prove or a template replay, when asked to stand up a test environment, seed test users or roles, or capture an auth session.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Bravos Env?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/bugb-technologies-bravos-env-bravos-plugins)
---
name: bravos-env
description: "Bring up a test target the user owns and prepare it for an authorized cxg run, under bravos's governance: loopback by default, a committed and reviewed scope.yaml, the human's own typed authorization, and a real session captured or imported, never invented. Use before bravos-prove or a template replay, when asked to stand up a test environment, seed test users or roles, or capture an auth session."
---
<!-- bravos:generated -->
> Paths that start with `SKILL_DIR/` are files in this skill's own folder, the folder that holds this SKILL.md.
# Bravos env: a target the user owns, ready for an authorized run
## When
- bravos-prove or bravos-recheck needs a running target and none is up.
- The user asks to start the app for testing, seed test users, roles or orgs, or capture a login session.
- A run was refused at pre-flight (cxg exit 4) or stopped on a dead session (exit 5).
- cxg looks missing: Before you say cxg is missing, check where it is: the briefing's `cxg:` line or `bravos doctor` names it when it is installed but its folder is not on this session's PATH (cxg lives in cargo's folder, `~/.cargo/bin`). Then it is not missing: run it by that full path, or start each command with `PATH="$HOME/.cargo/bin:$PATH"`, and tell the person once the line that fixes their shell. Only `bravos doctor` saying `✘ cxg` means it is not installed (`bravos setup --tools` installs it, with their go-ahead).
## Do
1. Read the current proving choice before target contact, login or auth verification. Use the owned local app named in the standing authorization or the target explicitly authorized for this invocation. The default is a loopback address (`127.0.0.1`, `localhost`, `[::1]`). Start it with the repo's own tooling (its compose file, dev server script or desktop build) and wait until it answers. In a bravos workspace each service has its own target: take the URLs from `bravos workspace show` (set a missing one with `bravos workspace target <name> <service>=http://127.0.0.1:<port>`), bring up every service the test crosses, and list every service host in the reviewed scope's `host_allowlist`.
2. On loopback, a recorded proving preference (`.guardlink/proving.md`, `choice: auto`) is the person's go-ahead for its target: use the recorded target and start command. With no recorded preference and the background pass on (the briefing's `Proving:` line says the default loopback grant applies), this machine's own app is the go-ahead's whole extent: start it yourself, in your own shell, from the recorded or documented development command, never from a Bravos hook. A cloned repository's start command is code that runs on this machine, so your own permission rules and folder trust apply; read it before you run it. Bind it to `127.0.0.1`, `localhost` or `[::1]`, and if it will not start, report "could not test" with the exact reason rather than asking. The default grant needs no `.guardlink/scope.yaml`: `bravos hook replay run-local` uses Bravos's own loopback-only scope. When you capture the build witness, set `BRAVOS_APP_START` to the exact command you ran, run from the repository's folder without cd into its absolute path (for compose, `docker compose [-f <file>] up -d` alone) (`BRAVOS_APP_START='<command>' bravos hook replay build <url>`): for destructive tests `bravos hook replay run-copy` starts its own throwaway copy with that command and no other, and removes it (bravos-prove step 5). Start the app with docker compose where the repository has a compose file, so the copy gets its own database and volumes. A development-command copy is refused when it would share the running app's local database or files, and the app should read `PORT` so the copy can run beside the developer's own. If the setup wizard left them empty, inspect the repository’s documented development command and listening address. When these match the app the person authorized, record the actual target and start command alongside their original words. Commit the policy and scope before automatic replay, with the person's go-ahead (the briefing's `Commits:` line is their standing answer; with no such line, ask once per session unless they already asked for commits). Ask only if the target or authority is ambiguous. If the user names a non-loopback target, stop and get two things before going on: the host listed in a committed `scope.yaml` that has been through a reviewed PR, and the human's authorization typed by them in this session in their own words. Without both, the target is out of scope; say so and stay on loopback.
3. Write the scope. Copy `SKILL_DIR/scope.example.yaml` to `.guardlink/scope.yaml`, then narrow `url_allowlist` to the routes under test. `method_allowlist` is a strict bound: cxg refuses every method it does not list, even with `--destructive-ok`, so a test that needs PUT, PATCH or DELETE needs the target's owner to add them in the reviewed PR; never add them yourself. Leave that field for the human to fill. Commit it, with the person's go-ahead (the briefing's `Commits:` line is their standing answer; with no such line, ask once per session unless they already asked for commits); an automatic run needs it merged to the default branch, and any non-loopback run needs it reviewed in a PR first.
4. Seed test data with the repo's own fixtures, seed scripts or admin endpoints: the roles and users the threats need, such as two users of different tenants for an ownership check. Name any test that needs production-like data as such, and run it only where that data is synthetic.
5. Get a session. On loopback, do it yourself: create the test accounts through the app's own signup, seed script or admin endpoint, write their login identity and secret to a gitignored file under `.bravos/`, and log in with `cxg pentest auth --target <url> --profile <name> --creds-file <file> --login-path <login route>`, one profile per identity a check needs. For a bearer-token API, check `cxg pentest auth --help` for dynamic-login support. Add `--login-user-field username` and `--login-pass-field password` when names differ (dotted paths support nested JSON), `--login-encoding form` for URL-encoded login, or `--login-body` for extra JSON fields; credential paths override those fields. Omit `--login-token-source` to discover the token by shape from the login response and save an `Authorization: Bearer` header profile; steer discovery only when needed with `--login-token-source json:/access_token` or `--login-token-source header:Authorization`. Capture each identity separately; probes use these profiles instead of minting their own tokens. For SSO, MFA or other browser-only login, drive signup and login in your own browser tool and capture the session interactively with `cxg pentest auth --target <url> --profile <name>`. For an authorized non-loopback target, ask the human to capture the session in their own browser with the same command, or to paste a storage state you import with `cxg pentest auth import --storage-state <file> --profile <name> --target <url>`; CI uses the import with a session the human exported once.
6. Verify the target URL and scope against the current recorded policy before sending any request. For a fresh local build or launch from this repository, capture the matching worktree witness at that time with `bravos hook replay build <loopback-url>`. Pass that output to bravos-prove in BRAVOS_REPLAY_BUILD, recording the actual target and revision. A hash computed beside a previously running app does not establish which code it serves. If a remote or already-running service cannot be tied to this build, report observations without updating the current claim. Confirm each required session is live with `cxg pentest auth verify --profile <name>` before handing the target on, so a run never spends its budget unauthenticated. `cxg pentest auth` (capture, import, verify) is the one pentest subcommand of cxg that Bravos uses: it is cxg's identity store, which `cxg scan --auth` reads, not cxg's pentest harness, and Bravos runs no cxg mode but `cxg scan` (bravos-prove's Never list).
7. Record the target URL, the profile names, the scope path and whether the target is loopback, and hand them to bravos-prove.
## Never
- Invent, guess or brute-force a credential, token or session. Use accounts you created through the app on loopback, or a session the human captured or pasted for any other target.
- Create accounts or log in yourself on a non-loopback target, or commit the test-account credentials file.
- Point any run at a host that is not loopback unless it is in a committed, reviewed `scope.yaml` and the human typed their authorization in this session.
- Write the `authorization_attestation` text yourself or paraphrase the human's words into it.
- Record a proving preference the person did not state; `.guardlink/proving.md` quotes their words and never covers a non-loopback target.
- Enable destructive probe classes against anything but a disposable loopback target, or add a `disposable_host_grants` entry.
- Seed or test against real user data.
- Write `@accepts`, `@entitles` or `@confirmed`; this skill prepares a target and judges nothing.
## Done when
- A target answers, and it is loopback or it is covered by a reviewed scope plus the human's typed authorization.
- `.guardlink/scope.yaml` exists, is committed and leaves `authorization_attestation` to the human.
- Each profile bravos-prove needs passes `cxg pentest auth verify --profile <name>`.
- You told the user what you seeded and which tests need data that is not synthetic.
## What it leaves for the next skill
- The target URL, profile names, scope path and the loopback verdict, for bravos-prove and bravos-recheck.
## Go deeper
- `SKILL_DIR/scope.example.yaml` — the loopback starter and what each field limits.
- `SKILL_DIR/../bravos-prove/SKILL.md` — what happens with the target next.