Skip to main content

Run a scan

Comply ships as a public Docker image, ghcr.io/ai-agentlens/comply. The image is built for linux/amd64, so on Apple silicon add --platform linux/amd64; Docker runs it under emulation.

On your machine, nothing uploaded​

From the root of a repository:

docker run --rm --platform linux/amd64 --network none \
-v "$PWD":/scan ghcr.io/ai-agentlens/comply:latest \
scan --path /scan --no-upload
Scanning /scan...
Found 12 AI usage points
Overall Risk: info (score: 0.0/10.0)
Total Findings: 12
low: 12

The overall risk is the worst open critical, high or medium finding, and the score rises within that level with how many are open. Low findings are inventory, such as SDK imports and model references, and don't raise it.

--network none is optional. It shows that the scan needs no network. Add --json for the full result, with every finding, its threat category and its controls. --json prints locally and never uploads.

Upload to AI Agent Lens​

  1. In AI Agent Lens, open Settings → API tokens & MCP and create a token. It starts with agl_.
  2. Pass it as AIAGENTLENS_TOKEN, and name the project:
docker run --rm --platform linux/amd64 \
-e AIAGENTLENS_TOKEN -v "$PWD":/scan ghcr.io/ai-agentlens/comply:latest \
scan --path /scan --project-key acme-payments-api

Results appear on the Compliance page under that project, and each run is kept in the project's history (the last 50).

Always pass --project-key in automation. Without it, Comply derives the key from the repository name in the git origin remote. Inside a container, git can refuse to read a checkout owned by another user, and then the upload is skipped. Two repositories with the same name in different GitHub organisations would also share a project.

In CI​

There is no packaged action yet; the image is all you need. A GitHub Actions job:

name: comply
on:
push:
branches: [main]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Comply scan
env:
AIAGENTLENS_TOKEN: ${{ secrets.AIAGENTLENS_TOKEN }}
run: |
docker run --rm -e AIAGENTLENS_TOKEN -v "$PWD":/scan \
ghcr.io/ai-agentlens/comply:latest \
scan --path /scan --project-key "${{ github.repository_owner }}-${{ github.event.repository.name }}"

scan exits 0 when it finds issues, because it reports rather than gates. A failed upload during scan is a warning, not an error. To make CI fail when the upload fails, use upload, which also needs the image's taxonomy and standards:

docker run --rm -e AIAGENTLENS_TOKEN -v "$PWD":/scan ghcr.io/ai-agentlens/comply:latest \
upload --path /scan --project-key acme-payments-api \
--taxonomy /usr/local/bin/taxonomy --compliance /usr/local/bin/compliance

What gets uploaded​

An upload sends the assessment for that repository:

  • every finding: rule id, threat category, compliance references, risk score, and the file path relative to the repository root with line and column;
  • the agent configuration Comply found: which agents use which models, MCP servers, skills and scripts. Credentials it recognises are redacted, both in the supporting evidence and inside the configuration itself. For example, a Claude Code allow-list entry such as Bash(curl -H "Authorization: Bearer …" …) is uploaded as Bash(curl -H "Authorization: ***" …). Redaction covers recognised credential shapes (bearer and API-key headers, URL credentials, api_key= parameters, secret-named NAME=value assignments), not every possible secret;
  • the project key and label, the scanner version, and coverage counts.

What is not uploaded by default:

  • source code, code snippets and surrounding lines;
  • values captured from your code inside a finding's message (the message template is sent instead);
  • git configuration values;
  • the absolute path of the checkout (only its last directory name).

--upload-snippets opts in to sending the matched source lines, which makes findings easier to review in the dashboard. Use it only for code you are comfortable storing in AI Agent Lens.

Without Docker​

The AgentShield cask (brew install --cask agentshield) also installs agentcompliance, the same scanner. It takes the same arguments (agentcompliance scan --path .). It has no rules of its own: on first use it downloads them from your organisation, so run agentshield login first. It needs Semgrep, and downloads it once if it is not installed.

Options​

FlagEffect
--path <dir>What to scan
--project-key <key>The project to upload to
--no-uploadNever upload
--jsonPrint the full result as JSON; never uploads
--upload-snippetsAlso upload the matched source lines
--token <token>Instead of AIAGENTLENS_TOKEN

Other commands: upload (scan and upload; exits non-zero if the upload fails), report (a Markdown compliance report) and generate-policy (From scan to runtime policy).