API Reference
MCP server, CLI, and the REST API for triggering and polling scans with a secret key
API Reference
Safeguard's programmatic surface is the MCP server, the CLI, and a REST API for starting and polling scans from a pipeline with a secret key.
MCP Server
The Model Context Protocol server at https://mcp.safeguard.sh/mcp is the
supported way to query Safeguard programmatically. It works with Claude,
Cursor, Cline, and any other MCP-capable client.
Configuration
For example, in Cursor's mcp.json:
{
"mcpServers": {
"safeguard": {
"url": "https://mcp.safeguard.sh/mcp"
}
}
}Clients that support OAuth open Safeguard's sign-in page; sign in and click
Authorize access. For a client that can only send a fixed header, create an
MCP key under Settings → Developer (key type MCP key) and send it as
Authorization: Bearer sg_sk_.... Safeguard hosts the server: there is nothing
to install. See MCP Integrations for each client.
Available tools
Six read-only tools for your data, plus five support tools. Scope (tenant, organization and product) comes from the account you connect with and is applied automatically; there is no scope argument to pass.
Arguments marked required must be supplied. Everything else is optional.
safeguard_list_products
Products in the active scope. Start here when you do not know which part of the estate you mean.
| Argument | Type | Notes |
|---|---|---|
name | string | Exact product name. Partial matching is not supported. |
limit | integer | Max products to return (default 50). |
offset | integer | Pagination offset (default 0). |
safeguard_list_projects
Projects in the active scope, with scan status and vulnerability counts.
| Argument | Type | Notes |
|---|---|---|
name | string | Exact project name. Partial matching is not supported. |
limit | number | Max projects to return. |
offset | number | Number of projects to skip. |
safeguard_get_project
The full record for one project, including components, vulnerabilities and attestations.
| Argument | Type | Notes |
|---|---|---|
project_id | string | Required. From safeguard_list_projects. |
safeguard_list_vulnerabilities
Vulnerabilities in the active scope.
| Argument | Type | Notes |
|---|---|---|
severity | string | all (default) does not filter. |
ecosystem | string | Package ecosystem. all (default) does not filter. |
cvss_min | number | Minimum CVSS score. |
limit | integer | 1-200, default 25. |
offset | integer | Number to skip, for paging. |
safeguard_get_vulnerability
The full record for one CVE, including references.
| Argument | Type | Notes |
|---|---|---|
cve_id | string | Required. For example CVE-2024-1234. |
safeguard_list_findings
Findings - vulnerability occurrences - for a specific SBOM or project.
| Argument | Type | Notes |
|---|---|---|
sbom_id | string | Filter by SBOM. |
project_id | string | Filter by project. |
severity | string | all (default) does not filter. |
status | string | Triage state. all (default) does not filter. |
limit | integer | 1-200. |
offset | integer | Number to skip, for paging. |
This list is generated from the server's own tool manifest and checked in CI
against https://mcp.safeguard.sh/openapi.json. If a tool is not listed here,
the server does not offer it.
Support tools
Five more tools are on for every signed-in user, unless a workspace administrator switches the Support and requests group off in Settings › MCP access, so an assistant can raise something with Safeguard or follow up on it. They file and read the same tickets as the product's Help & Feedback sheet, and only ever the signed-in user's own. A connection made with an API key alone can't file requests, and auditor-only accounts don't have these tools. More in Help and support.
safeguard_submit_feedback
Feedback, a feature request, praise or a complaint, sent to the Safeguard team.
| Argument | Type | Notes |
|---|---|---|
message | string | Required. The feedback, in the user's own words. |
type | string | feedback, feature_request, praise or complaint. |
rating | integer | 1 to 5, only if the user gave one. |
tool_name | string | The MCP tool it is about, if any. The name only, never its arguments. |
context | string | One sentence on what the user was doing. |
safeguard_report_bug
Something broken or wrong, filed as a ticket the engineering team triages.
| Argument | Type | Notes |
|---|---|---|
summary | string | Required. One-line summary. |
steps_to_reproduce | string | How to make it happen again. |
expected | string | What the user expected. |
actual | string | What happened instead. |
severity | string | low, medium, high or critical. |
affected_project | string | Project or product name, if any. |
tool_name | string | The MCP tool it is about, if any. |
context | string | One sentence on what the user was doing. |
safeguard_create_support_request
A question or problem for the support team, answered by email and in the app.
| Argument | Type | Notes |
|---|---|---|
subject | string | Required. Short subject line. |
description | string | Required. What the user needs help with. |
urgency | string | low, normal, high or urgent. |
tool_name | string | The MCP tool it is about, if any. |
context | string | One sentence on what the user was doing. |
safeguard_list_my_support_tickets
The user's own tickets, newest first, with reference, status and date.
| Argument | Type | Notes |
|---|---|---|
status | string | all, open or closed. |
limit | integer | Maximum number of tickets to return. |
safeguard_get_support_ticket
One of the user's own tickets, with the team's replies.
| Argument | Type | Notes |
|---|---|---|
reference | string | Required. The ticket reference (SUP-XXXX-XXXX) or its numeric id. |
When the MCP server runs on your own machine rather than as the hosted server,
safeguard_submit_feedback, safeguard_report_bug and
safeguard_create_support_request also take attachment_path: one local file
of up to 50 MB to attach.
Paging
List tools return a total alongside the rows. When the total exceeds the rows
you received, page with offset rather than assuming you have everything.
CLI
Install it with the one-line installer on CLI installation, which verifies the download against the published checksums.
Authentication
safeguard loginThis is an OAuth 2.0 device-code sign-in. /login inside the interactive
terminal does the same. The CLI does not read an API key from the environment.
Commands
# Scan a local directory, an image, a repository, or an existing SBOM
safeguard scan --dir .
safeguard scan --image nginx:latest
safeguard scan --sbom sbom.json
# Validate an SBOM against its specification
safeguard validate sbom.jsonThe full command list is on CLI usage, and
safeguard --help is authoritative for the build you have.
REST API
The CI/CD scan API lets a pipeline start a scan and read its result. It is the
API the safeguard ci scan command calls, and you can call it directly with
any HTTP client. Base URL: https://api.safeguard.sh/scm/api/v1/ci/scans.
Authenticate with a secret key from Settings → Developer, sent as
Authorization: Bearer sg_sk_.... The key carries your tenant and
organization, so there are no scope headers to send. Create it with the scopes
scans:trigger and scans:read, and optionally lock it to one project. A
secret key is accepted only on these /ci/ routes; a browser session is
refused. See CI/CD Integration.
| Method and path | Scope | What it does |
|---|---|---|
POST / | scans:trigger | Start a scan of a project's repository on a branch. |
GET /{scanId} | scans:read | Status of a scan, with vulnerability counts and steps. |
GET /{scanId}/gates?gate=<name or id> | scans:read | Gate outcomes for the scan. Omit gate for all gates. |
POST / takes a JSON body that names the project by projectId, project
(its name) or repositoryUrl, plus optional branch, commit, buildUrl
and ciProvider. It answers 202 with status: "triggered" for a new scan,
or 200 with status: "already_triggered" when that version is already
running or done. The scanId it returns is what you pass to the other two
routes. A project that was scanned only locally from the CLI has no stored
source to rescan and answers 409 PROJECT_NOT_RESCANNABLE.
curl -sS -X POST https://api.safeguard.sh/scm/api/v1/ci/scans \
-H "Authorization: Bearer $SAFEGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"project": "my-service", "branch": "main"}'GET /{scanId} reports finished, status, vulnerabilities (total,
critical, high, medium, low) and per-step results. The gates route reports
Passed, Failed, Warning, Not evaluated or Error for each gate and sets
pending to true while a policy has not been evaluated since the scan
completed.
Language models are served through the OpenAI-compatible inference API with an inference key. See SDKs and clients.
Single sign-on
The SSO endpoints under https://api.safeguard.sh/auth/api/v1/ are live and
supported. See SSO configuration for the callback, metadata and
access-request endpoints and their exact paths.
Notifications
Safeguard posts findings and events to Slack, Microsoft Teams and Discord. See Webhooks and events.
Rate limits
Rate limits apply per API key. Current limits and the plans they attach to are published on the pricing page - that page is the source of truth, and this one no longer duplicates it.
SDKs
Safeguard publishes official SDKs for TypeScript, Python and Go that send prompts to Safeguard AI and keep conversations: see Safeguard AI SDKs. For everything else, connect through the MCP server, which most agent frameworks support natively, or call the REST API above directly. Guard agents are installed from registry.safeguard.sh (see Guard SDK).
Audit Trail
How Guard records every policy decision as an audit event, rolls those events up into aggregates for reporting, and how to query the trail.
What Safeguard Can Analyse
Every input Safeguard reads (installers, archives, disk and VM images, containers, mobile and macOS apps, Linux packages, firmware, lockfiles and existing SBOMs), the SBOM and VEX formats it writes, the analyses it runs and the ways to send it files.