`cbx audit` failures
Errors running cbx audit aws: LLM preflight, rule-pack resolution, AWS permissions, discovery integrity, CI integration.
cbx audit failures
cbx audit aws is the only audit subcommand. It reads your live AWS account through the SDK, grounds every finding in CloudBooster's curated AWS knowledge and rule pack, and runs a local LLM CLI (claude -p by default, or codex exec via --llm-executor codex) to produce cited findings. Most failures fall into four buckets: the LLM preflight, rule-pack resolution, AWS auth/permissions, and discovery integrity.
E_LLM_PREFLIGHT: the grounding LLM isn't ready
Before it touches AWS, cbx audit aws probes the LLM executor it will use to ground findings. If that probe fails, the command aborts early with E_LLM_PREFLIGHT — before any AWS spend.
Common causes and fixes:
| Cause | Fix |
|---|---|
The CLI isn't on PATH | Install claude (or codex) and make sure it's reachable. The executor binary must be on PATH. |
| Bad or missing auth | Re-authenticate the executor: cbx llm api login claude (or cbx llm api login codex). |
| Revoked / unavailable model | Clear the pin or set a valid one with cbx llm model <provider> <model>, or pass --llm-model <model> for a single run. |
| Usage / rate limits hit | Wait for the limit to reset, or switch executors with --llm-executor codex. |
Verify a local executor directly before re-running the audit:
If cbx llm cli test passes but the audit still fails preflight, you likely pinned a model the executor can't serve — drop --llm-model or fix the stored model with cbx llm model.
Rule-pack resolution failure
Every cbx audit aws run grounds findings in CloudBooster's AWS rule pack. The CLI resolves it in order: an explicit override (CBX_AUDIT_RULES_FILE), then the rule-pack registry over the CB knowledge API, then the local cache at ~/.cache/cbx/rulepack/. If the registry is unreachable and the cache is cold and no override is set, the audit aborts before any AWS spend.
Fix: run the audit once while online — a single successful run populates ~/.cache/cbx/rulepack/, after which audits work offline against the cached pack. To run fully offline or in an air-gapped environment, point at a local copy:
To pin a specific rule-pack version (for reproducible CI), use --rulepack-version or CBX_RULEPACK_VERSION:
AWS auth and permission errors
The audit reads live AWS via the SDK, so it needs working credentials and read permissions for the services it discovers.
Use your normal AWS credential resolution (environment, shared config, SSO), or point at a specific file:
When a describe-* call is denied, the finding set will carry permission errors instead of results. Run with --diagnose to get a recommended least-privilege IAM policy covering everything the audit tried to read:
Attach the emitted policy to the principal you're auditing with, then re-run.
Discovery-integrity warnings
When discovery is partial — a region times out, a service throttles, or a paginated list is cut short — the audit reports discovery-integrity warnings alongside its findings. By default the audit still completes and reports what it found. If you need a clean, complete discovery (for example in CI, where a partial scan shouldn't pass), use --strict to make those warnings fail the run:
Throttling is the usual trigger. Lower the AWS-side concurrency so large accounts don't hit rate limits:
Scope to specific regions (repeatable, or all) to shrink the blast radius:
CI integration
For machine-readable output in CI, use the global --json (or -o json) flag — findings are wrapped in the standard envelope so a non-zero exit signals findings at or above the severity threshold.
Two things break CI runs most often:
- LLM preflight in headless runners — the grounding CLI (
claude/codex) must be installed and authenticated on the runner. A failed preflight exits non-zero withE_LLM_PREFLIGHT. Test it withcbx llm cli test claude-codeas a setup step. - Cold rule-pack cache + no network — if the runner can't reach the registry and has no cache, resolution fails. Bake
CBX_AUDIT_RULES_FILE(or warm the cache) into the runner image, and pin--rulepack-versionso results are reproducible across runs.
Add --no-tui to disable the interactive TUI in non-interactive environments.
See also
- Use
cbx audit— practical recipe. - Audits — what audits check and how.
- Run
cbx auditin GitHub Actions — CI integration.