Introducing a new way to review your PRs.

Read the announcement

affaan-m / agentshield

AI agent security scanner. Detect vulnerabilities in agent configurations, MCP servers, and tool permissions. Available as CLI, GitHub Action, ECC plugin, and GitHub App integration. 🛡️

View on GitHub

20 documents · Updated Sep 11, 2026

docs / github-action-entrypoints

GitHub Action entrypoints

The GitHub Action is the CI entry point for turning a repository scan into findings, scores, governance results, and review evidence. It uses one primary action with optional modes for baseline drift, package-manager hardening, policy checks, policy promotion, supply-chain checks, and evidence-pack creation. See Automation orchestration for the wider automation flow and Opus analysis orchestration for the related analysis path.

Action contract

The action contract is defined by home/…/action.yml. A workflow gives the action a scan path and optional controls. The action then reports through GitHub outputs, annotations, the step summary, SARIF, and its process exit status.

The action runs with these broad controls:

ControlPurpose
Scan path and severitySelect the repository area and the findings that reach CI output and the default findings gate.
Failure gatesDecide whether findings, policy violations, baseline regressions, or supply-chain risk fail the job.
Comparison and governanceCompare with a saved baseline or evaluate an organization policy.
Promotion and evidenceVerify a policy pack or write a hashed evidence bundle for later review.

Outputs describe both the scan and any enabled mode. A workflow can use these values to publish artifacts or route a job without parsing log text. The exit status remains the final gate signal for the workflow.

Shared scan path

The primary action first resolves the target under the GitHub workspace and runs the shared scanner. That scan discovers supported configuration files and applies the built-in security rules. The action filters findings by the requested minimum severity, calculates the score and grade, emits annotations, and writes the common summary before it runs the optional checks.

The same scan result feeds the policy, baseline, hardening, supply-chain, and evidence flows. This keeps each mode tied to one view of the repository instead of running separate scans with different inputs.

When a target path does not exist, the action reports an error and stops. When a mode cannot load or verify its input, the action publishes that mode's error and may fail the job according to the mode's gate setting.

References: src/action.ts• L48-69 src/action.ts• L135-193 src/action.ts• L388-400 src/…/index.ts• L17-35

GitHub result surfaces

The action presents the same result to several CI consumers. High and critical findings become error annotations. Lower-severity findings become warning annotations. The job summary adds human-readable sections for the scan and every enabled specialized mode.

SurfaceRole
OutputsStable values for later workflow steps, such as score, status, counts, paths, and digests.
AnnotationsFile-linked feedback for findings and policy violations in the pull request or job view.
Step summaryReview context for drift, policy, hardening, supply-chain, and promotion decisions.
SARIFCode-scanning input when the workflow selects SARIF output.
Exit statusThe final allow or block decision after enabled gates are evaluated.

The action initializes mode outputs to not-run or zero values before optional work starts. This gives downstream steps a predictable contract even when a workflow enables only the base scan.

References: src/action.ts• L54-86 src/action.ts• L101-113 src/action.ts• L195-242 src/action.ts• L533-560 action.yml• L87-151

Specialized action modes

Each specialized mode adds one decision or evidence step around the shared scan. The modes can be used together because they consume the same findings and score, while each mode keeps its own status and failure rule.

Baseline comparison

Baseline comparison checks whether the current security posture has changed from an accepted JSON baseline. The action can save the current filtered findings as a new baseline, or load an existing baseline and compare finding fingerprints, resolved findings, unchanged findings, and score change.

The baseline gate focuses attention on regression. It reports new findings as annotations and fails when the comparison crosses the configured limits for new critical or high findings, total new findings, or score loss. A missing or invalid baseline produces a missing status and skips comparison rather than treating the current scan as a clean comparison.

References: src/action.ts• L451-495 src/action-baseline.ts• L3-76 src/…/compare.ts• L19-46 src/…/compare.ts• L69-177

Package-manager hardening

Package-manager hardening is a focused view of findings that start with the package-manager rule group. It turns those findings into a small CI signal about registry credentials, lifecycle scripts, and release-age controls.

The mode reports hardened when no package-manager findings exist and needs-review when they do. It writes counts and a summary for review, but it does not create a separate hardening failure gate. The normal findings gate can still block the job when the hardening findings meet the selected severity threshold.

References: src/action.ts• L188-191 src/action.ts• L216-240 src/action.ts• L388-401 src/action-hardening.ts• L3-14 src/action-hardening.ts• L30-88

Policy evaluation

Policy evaluation checks the shared scan against an organization policy. The policy can set a minimum score and limits for findings, tools, MCP servers, deny-list entries, and hooks. Active exceptions can remove matching violations from the enforcement result, while expired exceptions remain visible as violations.

The action loads and validates the policy file, evaluates it against the filtered findings and discovered files, then reports compliance, violations, owners, and exception status. A non-compliant result fails the job by default when fail-on-policy is enabled. A missing or invalid policy is an error and follows the same gate setting.

References: src/action.ts• L143-145 src/action.ts• L279-327 src/action-policy.ts• L3-88 src/…/evaluate.ts• L31-47 src/…/evaluate.ts• L49-176

Policy promotion

Policy promotion verifies an exported policy pack before it becomes the active policy used by the scan. The promotion input is a manifest that names a policy file and its SHA-256 digest. The action checks the manifest, file digest, policy schema, and pack identity before it writes the selected policy unless dry-run mode is active.

Promotion also produces review items for digest verification, owner review, protected rollout, and a runtime smoke scan. A non-dry-run promotion can supply the resulting policy path to the policy evaluation step when no policy path was given. The promotion mode is report-only by default; fail-on-policy-promotion blocks the job when review items still require action.

References: src/action.ts• L145-149 src/action.ts• L254-277 src/action.ts• L330-371 src/action-promotion.ts• L6-57 src/…/promote.ts• L20-119 src/…/promote.ts• L122-179

Supply-chain verification

Supply-chain verification checks MCP package references discovered in the scanned configuration. It combines package provenance with known package risk checks and can optionally query npm registry metadata. The result gives workflows a view of package count, risky packages, critical and high risk, and provenance quality.

The mode runs by default and uses offline IOC and provenance checks unless online registry checks are requested. It reports clean or risky. When its gate is enabled, only critical or high package risk fails the action. Workflows can therefore collect lower-risk evidence without blocking, or can make supply-chain risk part of the release boundary.

References: src/action.ts• L150-155 src/action.ts• L402-449 src/action-supply-chain.ts• L3-60 src/…/index.ts• L1-13

Evidence pack

The evidence-pack mode turns the scan and enabled mode results into a review bundle. It includes the main report plus policy, baseline, supply-chain, CI context, and remediation views. Each artifact is hashed and the bundle has a digest so a later reviewer can check that the evidence was not changed.

The action writes the bundle when evidence-pack is set and verifies it by default. Verification failure stops the action. The bundle also carries redacted CI and runtime context, which lets later review connect the result to a workflow run without requiring the reviewer to inspect live runner state.

References: src/action.ts• L156-157 src/action.ts• L498-531 src/…/index.ts• L14-49 src/…/index.ts• L291-419 src/…/index.ts• L421-507

Mode coordination

The action coordinates the modes as one workflow around a shared scan. Policy promotion runs early so a newly written policy can become the policy input. Policy evaluation then produces governance status. The action writes the common report and hardening summary, checks supply-chain risk, handles baseline save and comparison, and finally creates the evidence pack from all results.

The following diagram shows the high-level relationship between the shared scan and the specialized action paths.

flowchart TD
    A[Workflow inputs] --> B[Resolve workspace target]
    B --> C[Shared repository scan]
    C --> D[Severity filter and score]
    D --> E[Annotations and common summary]
    D --> H[Package-manager hardening view]
    D --> I[Policy promotion]
    I --> J[Policy evaluation]
    D --> K[Supply-chain verification]
    D --> L[Baseline save or comparison]
    E --> M[Evidence pack]
    H --> M
    J --> M
    K --> M
    L --> M
    M --> N[Outputs and exit status]
    J --> N
    K --> N
    L --> N
    E --> N

The final exit status is the union of the active failure decisions. A workflow can use one mode as an enforcing gate and use the other modes as evidence or review signals.

References: src/action.ts• L179-252 src/action.ts• L254-386 src/action.ts• L388-449 src/action.ts• L451-560

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the input names, defaults, output names, and status values aligned between action.yml and the orchestration in src/action.ts.
  • Keep each specialized summary status aligned with the failure decision that consumes it. A status can be report-only even when its result appears in the job summary.
  • If the scan result or finding shape changes, check baseline fingerprints, policy evaluation, hardening grouping, supply-chain extraction, and evidence-pack summaries together.
  • If policy promotion changes its review items or digest rules, update the runtime smoke link between promotion and policy evaluation.
  • If evidence-pack artifacts or digest inputs change, keep pack writing, verification, and downstream inspection aligned.
  • If a new mode is added, initialize its outputs and include its result in the evidence pack before relying on it in later workflow steps.

Important failure modes

TriggerConsequenceGuard
The configured scan path does not exist under the workspace.The action reports an error and exits with failure.Check the workflow path and workspace-relative input.
A baseline is absent or cannot be parsed.Drift comparison is skipped and the baseline status is missing.Create and persist a valid baseline before enabling regression enforcement.
A policy file is absent or invalid.Policy status is error; the job fails when policy enforcement is enabled.Validate the policy file in the same change that enables it.
A policy export digest or pack identity does not match the manifest.Promotion stops before writing the active policy.Promote only the policy file named and hashed by the export manifest.
A supply-chain report has critical or high package risk while its gate is enabled.The action fails after publishing the risk report.Pin, replace, remove, or explicitly review the package before release.
An evidence-pack artifact is changed or missing after creation.Evidence-pack verification fails and the action exits with failure.Treat the verified bundle digest as the integrity check for downstream review.

Key files

FileWhy to read it
home/…/action.ymlDefines the public GitHub Action inputs, outputs, runtime, and primary entrypoint.
home/…/action.tsShows how one scan is coordinated with all optional modes and how the final gate is selected.
home/…/index.tsExplains the shared scan result consumed by every mode.
home/…/action-baseline.ts and home/…/compare.tsExplain baseline drift status, comparison, and regression gates.
home/…/action-hardening.tsExplains the package-manager hardening view exposed to CI.
home/…/action-policy.ts and home/…/evaluate.tsExplain policy status, violations, and exception handling.
home/…/action-promotion.ts and home/…/promote.tsExplain policy-pack verification, promotion review, and runtime smoke evidence.
home/…/action-supply-chain.ts and home/…/index.tsExplain supply-chain status and the shared package verification capability.
home/…/index.tsExplains how action results become verified, review-ready evidence.