RiskRift API

Start website security scans from your own tools or your CI/CD pipeline, and collect the results as JSON, SARIF or PDF.

Base URL
https://riskrift.com/api/v1
Authentication
API key, as a bearer token
Formats
JSON, SARIF 2.1.0, PDF
Description
OpenAPI 3.1

Before you build. RiskRift tests sites exposed to the internet, on a hostname you verified. A scan is real testing and can take several hours: start it, then collect the result later.

Quick start

  1. Verify your domain. In your workspace, once for each hostname, by DNS, file or email.
  2. Create a key. On the API page. Begin with a test key: it simulates scans in 25 seconds, free of charge.
  3. Start a scan, wait, download.
# The key comes from your secret store, never from the code.
export RISKRIFT_API_KEY="rr_test_…"

# 1. Check the key
curl -sS https://riskrift.com/api/v1/account \
  -H "Authorization: Bearer $RISKRIFT_API_KEY"

# 2. Start a scan
curl -sS https://riskrift.com/api/v1/scans \
  -H "Authorization: Bearer $RISKRIFT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"target": "https://staging.example.com/", "authorized": true, "spend_limit_cents": 1500}'

# 3. Follow it until "status" is "completed"
curl -sS https://riskrift.com/api/v1/scans/$SCAN_ID \
  -H "Authorization: Bearer $RISKRIFT_API_KEY"

# 4. Download the results
for format in json sarif pdf; do
  curl -sS -o report.$format https://riskrift.com/api/v1/scans/$SCAN_ID/report.$format \
    -H "Authorization: Bearer $RISKRIFT_API_KEY"
done
import os, time, uuid
import requests

api = requests.Session()
api.headers["Authorization"] = "Bearer " + os.environ["RISKRIFT_API_KEY"]
BASE = "https://riskrift.com/api/v1"

response = api.post(BASE + "/scans", headers={"Idempotency-Key": str(uuid.uuid4())}, json={
    "target": "https://staging.example.com/",
    "authorized": True,
    "spend_limit_cents": 1500,
})
scan = response.json()
if not response.ok:
    raise SystemExit(f"{scan['code']}: {scan['detail']}")

while scan["status"] not in ("completed", "failed", "cancelled", "action_required"):
    time.sleep(int(response.headers.get("Retry-After", 30)))
    response = api.get(f"{BASE}/scans/{scan['id']}")
    response.raise_for_status()
    scan = response.json()

if scan["status"] != "completed":
    raise SystemExit("The scan is " + scan["status"])
report = api.get(scan["report"]["json_url"]).json()
for finding in report["findings"]:
    print(finding["severity"], finding["title"], finding["locations"][0]["url"])
const base = "https://riskrift.com/api/v1";
const headers = { Authorization: `Bearer ${process.env.RISKRIFT_API_KEY}` };

let response = await fetch(`${base}/scans`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({ target: "https://staging.example.com/", authorized: true, spend_limit_cents: 1500 }),
});
let scan = await response.json();
if (!response.ok) throw new Error(`${scan.code}: ${scan.detail}`);

while (!["completed", "failed", "cancelled", "action_required"].includes(scan.status)) {
  await new Promise((done) => setTimeout(done, 1000 * Number(response.headers.get("Retry-After") ?? 30)));
  response = await fetch(`${base}/scans/${scan.id}`, { headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  scan = await response.json();
}

const report = await (await fetch(scan.report.json_url, { headers })).json();
console.log(report.summary.findings_by_severity);

Test mode

Keys that begin with rr_test_ simulate scans. Nothing is contacted, nothing is charged and no domain has to be verified. A simulated scan goes through the same statuses in about 25 seconds and ends with a fictional report, marked as such, in all three formats.

TargetSimulated result
Any public URLCompleted, with 1 high, 1 medium and 1 low finding
https://clean.…Completed, without findings
https://failed.…Failed

Simulated scans have "test": true, are kept for seven days, do not appear in the workspace and send no webhook. Their PDF is always the same fictional document. To try your webhook, use “Send test event” on the API page.

API keys

Send the key in the Authorization header of every request. There is no other way: no cookie, no key in the URL.

Authorization: Bearer rr_live_…

You create and revoke keys on the API page of your workspace. A key is shown once: we only keep a hash of it. We email you whenever a live key is created.

SettingWhat it does
Modelive runs real scans, test simulates them.
AccessRead results (scans:read), or also start, finish and cancel scans (scans:write).
DomainAll your verified domains, or a single hostname. A restricted key sees and scans nothing else.
Spending capThe most this key may reserve or spend over 30 days. “$0” allows your free scan only.
Lifetime30 days, 90 days (default), one year, or no expiry.

Good practice

  • One key per pipeline or tool, with the least access it needs, so that you can revoke one without breaking the others.
  • Keep it in your CI secrets or a secret manager. Never in the code, a URL, a mobile app or a web page.
  • To rotate: create the new key, deploy it, check “Last used” on the old one, then revoke it.
  • If a key leaks, revoke it first. It stops working at once. Then look at your recent scans.
  • Secret scanners can recognize our keys: rr_(live|test)_[0-9A-Za-z]{42}. The last six characters are a checksum.

A key acts for your account only. It never gives administrator rights, and it cannot manage keys, domains, payments or webhooks.

Conventions

  • HTTPS only. Requests and responses are UTF-8 JSON, except reports in other formats.
  • Times are UTC, in the form 2026-11-25T12:00:00Z. Unknown times are null.
  • Amounts are whole US cents: 1500 is $15.00.
  • Unknown request parameters are refused, so that a typo never goes unnoticed.
  • Responses can gain fields and values over time. Ignore the ones you don’t know. See Versioning.
  • Every response has a Request-Id. Include it when you write to hello@riskrift.com.
  • The API is for servers. Browsers on other origins cannot call it, because a key in a web page is a leaked key.

Pagination

Lists return data, has_more and next_cursor. Send next_cursor back as cursor to get the next page. Treat it as opaque text.

Safe retries

Networks fail after a request was received. Send an Idempotency-Key with POST /scans, such as a UUID made once per intended scan. Repeating the same request with the same value within 24 hours returns the scan already created, with the header Idempotent-Replayed: true, and starts nothing. The same value with a different request is refused.

Without this header, a second scan of the same target still cannot run next to the first: the API answers scan_in_progress.

Rate limits

WhatLimit
Requests120 per minute and per account, all keys together
Scans in progress5 per account, and one per target
Simulated scans200 per day
Request body64 KB
Keys and webhooks20 keys, 5 webhooks

Responses carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds). When you are over, the answer is 429 with Retry-After. While a scan is in progress, GET /scans/{scan_id} also sends Retry-After: wait that long before asking again.

Errors

Errors follow RFC 9457 (application/problem+json). Rely on code: titles and details are written for people and can change. Some errors add fields, shown below.

{
  "type": "https://riskrift.com/docs#error-insufficient_credit",
  "title": "Not enough credit",
  "status": 402,
  "code": "insufficient_credit",
  "detail": "Your balance does not cover this spending limit. Add credit in your workspace.",
  "request_id": "req_5f0c2b7e9d1a4c38a6b0e1f2",
  "param": "spend_limit_cents",
  "available_cents": 250,
  "required_cents": 1500,
  "payment_needed_cents": 1500
}
CodeStatusMeaning and what to do
missing_api_key401No bearer token was sent.
invalid_api_key401Unknown, mistyped or revoked key.
expired_api_key401Create a new key in your workspace.
account_unavailable401The account was closed during the request.
account_suspended403Write to hello@riskrift.com.
insufficient_scope403This key is read-only.
key_domain_restricted403This key works with another hostname.
key_spend_cap_exceeded403The cap of this key over 30 days. Adds remaining_cents.
domain_not_verified403Verify this exact hostname in your workspace. A subdomain is another hostname.
spend_limit_required402The free scan is used. Send spend_limit_cents.
insufficient_credit402Add credit in your workspace. Nothing was created. Adds available_cents, required_cents and payment_needed_cents.
invalid_request400, 422Missing or invalid parameters, listed in errors.
invalid_target400Not a public http(s) address, or it does not resolve to the public internet.
invalid_login400The test account cannot be used as sent.
invalid_login_url400It must be a public address on the same origin as the target.
authorization_required400authorized must be true.
idempotency_key_reused422This Idempotency-Key belongs to a different request.
scan_in_progress409This target is already being scanned. Adds scan_id: follow it.
not_cancellable409The scan has started. Finish it instead. Adds scan_status.
not_finishable409Not possible in this status. Adds scan_status.
report_not_ready409Wait for completed. Adds scan_status.
report_unavailable404This scan ended without a report.
scan_not_found404No such scan for this key. Test and live scans are separate.
not_found404This path does not exist.
method_not_allowed405This path does not support that method.
request_too_large413Send at most 64 KB.
rate_limited429Wait for Retry-After seconds.
too_many_active_scans429Wait for one of your scans to end.
too_many_failures429Too many invalid keys from your network.
test_limit_reached429Too many simulated scans today.
internal_error500On our side. Retry with the same Idempotency-Key.

Start a scan

POST /scans

Starts a scan of a verified hostname and returns a scan object at once, with status 201. Needs a key that may launch scans.

ParameterTypeDescription
targetrequiredstringPublic http(s) URL. Its exact hostname must be verified in your workspace.
authorizedrequiredbooleanMust be true. You confirm that you own this application or are explicitly authorized to test it.
spend_limit_centsinteger500 to 50000. Most this scan may cost. Required once your free scan is used, ignored while it is available.
on_limitstringfinish (default): at the limit, stop and prepare the report. pause: wait for your decision in the workspace.
loginobjectTest behind a login, with a dedicated test account.
login.usernamerequiredstringUp to 200 characters.
login.passwordrequiredstringUp to 500 characters. Encrypted until the report is ready, then erased here. Never returned. It is given to the scan engine and can be processed by its AI provider.
login.urlstringSign-in page, on the same origin as the target.
metadataobjectUp to 20 labels of your own (commit, branch, build), as strings: names up to 40 characters, values up to 500. Returned as sent, never given to the scan engine.

Optional header: Idempotency-Key, 1 to 255 visible ASCII characters. See Safe retries.

{
  "target": "https://staging.example.com/",
  "authorized": true,
  "spend_limit_cents": 1500,
  "login": {
    "username": "security-test@example.com",
    "password": "from your secret store",
    "url": "https://staging.example.com/login"
  },
  "metadata": {"commit": "9f2c1ab", "branch": "main"}
}

What it costs

Your free scan is used first: one per account and per domain, two hours of testing at most. After it, spend_limit_cents is set aside on your balance, the scan is charged for what it really uses, and never more than that limit. Nothing is charged when no report is delivered. If the balance is too low, the request is refused and nothing is created. There is no automatic top-up. See pricing.

Get a scan

GET /scans/{scan_id}

Returns a scan object. Ask again after Retry-After seconds until status is completed, failed or cancelled, or use a webhook.

List scans

GET /scans

Most recent first, including scans started in the workspace.

ParameterTypeDescription
limitinteger1 to 100. Default 20.
cursorstringnext_cursor of the previous page.
statusstringOnly scans with this status.

Finish early

POST /scans/{scan_id}/finish

Stops testing and prepares the report from what was collected. coverage is then partial. Repeating it has no further effect.

Cancel before it starts

POST /scans/{scan_id}/cancel

Only while nothing has started. Nothing is charged, and a free scan that was not used becomes available again.

The scan object

{
  "object": "scan",
  "id": "0b6f3a52-6f0e-4c51-9f2d-2a7f3d1c8e90",
  "test": false,
  "target": "https://staging.example.com/",
  "hostname": "staging.example.com",
  "status": "completed",
  "action_required": null,
  "queue_position": null,
  "authenticated": false,
  "coverage": "complete",
  "end_reason": "finished",
  "created_at": "2026-11-25T12:00:00Z",
  "started_at": "2026-11-25T12:00:14Z",
  "finished_at": "2026-11-25T15:41:08Z",
  "findings": {
    "total": 6, "critical": 0, "high": 1, "medium": 2, "low": 3, "informational": 0,
    "highest_severity": "high"
  },
  "report": {
    "status": "ready",
    "json_url": "https://riskrift.com/api/v1/scans/0b6f3a52-6f0e-4c51-9f2d-2a7f3d1c8e90/report.json",
    "sarif_url": "https://riskrift.com/api/v1/scans/0b6f3a52-6f0e-4c51-9f2d-2a7f3d1c8e90/report.sarif",
    "pdf_url": "https://riskrift.com/api/v1/scans/0b6f3a52-6f0e-4c51-9f2d-2a7f3d1c8e90/report.pdf"
  },
  "billing": {
    "mode": "paid", "currency": "usd", "spend_limit_cents": 1500, "on_limit": "finish",
    "spent_cents": 412, "charged_cents": 412
  },
  "error": null,
  "metadata": {"commit": "9f2c1ab", "branch": "main"},
  "dashboard_url": "https://riskrift.com/?assessment=0b6f3a52-6f0e-4c51-9f2d-2a7f3d1c8e90"
}
FieldDescription
objectAlways scan.
idUUID of the scan.
testTrue for a simulated scan.
target, hostnameThe scanned URL and its hostname.
statusSee the table below.
action_requiredNull, or what is needed from you: action_required.reason (payment_required, domain_verification_required or spend_limit_reached) and action_required.message.
queue_positionPlace in line while queued. Waiting costs nothing.
authenticatedTrue when a test account is used.
coveragecomplete, or partial when testing stopped before the end. Null while in progress.
end_reasonfinished, time_limit (two-hour free scan), finished_early (by you, or at the spending limit), cancelled or interrupted.
created_at, started_at, finished_atWhen it was requested, when testing began and when it ended.
findingsNumber of finding records, below.
findings.totalNumber of finding records: live while running, final once completed. Duplicates are not merged.
findings.critical, findings.high, findings.medium, findings.low, findings.informationalThe same, by recorded severity.
findings.highest_severityMost serious recorded severity, or null without findings. No finding does not prove that the site is secure.
reportThe report and where to get it, below.
report.statuspending, ready or unavailable.
report.json_url, report.sarif_url, report.pdf_urlAddresses of the report, once ready. They need your key.
billingWhat it costs, below.
billing.modefree, paid or test.
billing.currencyAlways usd.
billing.spend_limit_cents, billing.on_limitAs requested. Null for a free scan.
billing.spent_centsUsage so far, never above the limit.
billing.charged_centsFinal amount once settled, null before. 0 when no report was delivered.
errorNull, or for a failed scan error.code (scan_interrupted or report_unavailable) and error.message.
metadataYour labels, as sent.
dashboard_urlThe scan in your workspace. Null for a simulated scan.

Statuses

StatusMeaning
queuedAccepted, waiting for a place.
runningTesting.
pausedPaused in the workspace.
action_requiredNeeds a decision from you. See action_required.
finishingTesting is over, the report is being prepared.
completedFinal. The report is ready.
failedFinal. Interrupted, or without a report. Not charged. If report.status is ready, a report on what was collected is available.
cancelledFinal. Cancelled before it started.

Report formats

FormatUse it forContains
JSONYour own tools, tickets, dashboardsEverything: summary, findings, evidence, steps, fixes
SARIF 2.1.0Code-scanning tools, such as GitHub or GitLabTitles, severities, weaknesses and locations
PDFPeople: management, clients, your agencyThe complete report

Reports explain how to attack your site. Keep them private: no public repository, public build artifact or public ticket. Their text quotes your application’s answers, so escape or sanitize it before showing it on a web page.

JSON report

GET /scans/{scan_id}/report.json

Follows a published JSON Schema (draft 2020-12), version 1.0. Within version 1, properties are only added: your parser keeps working.

{
  "$schema": "https://riskrift.com/schemas/report-1.0.json",
  "schema_version": "1.0",
  "generator": {"name": "RiskRift", "url": "https://riskrift.com/"},
  "test": false,
  "scan": {
    "id": "0b6f3a52-6f0e-4c51-9f2d-2a7f3d1c8e90",
    "target": "https://staging.example.com/",
    "hostname": "staging.example.com",
    "authenticated": false,
    "coverage": "complete",
    "end_reason": "finished",
    "created_at": "2026-11-25T12:00:00Z",
    "started_at": "2026-11-25T12:00:14Z",
    "finished_at": "2026-11-25T15:41:08Z",
    "metadata": {"commit": "9f2c1ab"}
  },
  "summary": {
    "findings_total": 1,
    "findings_by_severity": {"critical": 0, "high": 1, "medium": 0, "low": 0, "informational": 0},
    "highest_severity": "high",
    "executive_summary_markdown": "…",
    "methodology_markdown": "…",
    "limitations_markdown": "…",
    "recommendations": ["…"]
  },
  "findings": [
    {
      "id": "42",
      "reference": "F-042",
      "fingerprint": "5d0c1f7a9be24c6f83d1a2b4c6e8f001:1",
      "title": "Order totals can be changed by the browser",
      "severity": "high",
      "triage_status": "pending",
      "category": "Business logic / client-side pricing (CWE-602)",
      "cwe": ["CWE-602"],
      "owasp": ["API6:2023"],
      "locations": [{"method": "POST", "url": "https://staging.example.com/api/checkout"}],
      "recorded_at": "2026-11-25T13:12:40Z",
      "evidence_reference": "118",
      "summary": "…",
      "sections": {
        "overview": "…", "impact": "…", "measured_impact": null, "affected_scope": "…",
        "reproduction_steps": "…", "evidence": "…", "proof_of_concept": "…",
        "root_cause": "…", "remediation": "…"
      },
      "body_markdown": "…"
    }
  ],
  "integrity": {"evidence_sha256": "3f79bb7b435b05321651daefd374cdc681dc06faa65e374e38337b88ca046dea"}
}
  • severity is the recorded severity, not a CVSS score. triage_status is pending until a person has reviewed the finding.
  • cwe and owasp are the identifiers recorded with the finding. They can be empty.
  • sections splits body_markdown by topic. A topic that the finding does not have is null.
  • fingerprint is the same weakness class on the same first location. It helps compare two scans, but it is best effort: an AI-driven scan does not always word or place a finding the same way. Do not treat a missing fingerprint as a fixed issue.

SARIF report

GET /scans/{scan_id}/report.sarif

SARIF 2.1.0 is the OASIS standard that code-scanning tools read. Full evidence is left out on purpose.

SARIFContent
ruleIdWeakness and severity, such as CWE-89/high
levelerror for critical and high, warning for medium, note for low and informational
security-severityA number in the band GitHub uses for that severity, so that it shows the same label. Not a CVSS score.
artifactLocation.uriHostname and path: a website has no source file
webRequestMethod and path of the affected request, when recorded
partialFingerprintsThe same best-effort fingerprint as in the JSON report

PDF report

GET /scans/{scan_id}/report.pdf

The same document as in the workspace. See a complete sample.

Key and balance

GET /account

The quickest way to check a key: what it may do, and your account’s credit.

{
  "object": "account",
  "id": "7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
  "free_scan_available": false,
  "credit": {"currency": "usd", "available_cents": 4250, "held_cents": 1500},
  "key": {
    "name": "Staging pipeline",
    "mode": "live",
    "scopes": ["scans:read", "scans:write"],
    "hostname": "staging.example.com",
    "spend_cap_cents": 5000,
    "spend_used_cents": 1412,
    "expires_at": "2027-02-23T12:00:00Z"
  }
}

Domains

GET /domains

The hostnames you can scan. You verify each one once, in the workspace, and it stays verified until you remove it.

{
  "object": "list",
  "data": [
    {"object": "domain", "hostname": "staging.example.com", "verified_at": "2026-11-25T09:30:00Z", "method": "dns", "free_scan_available": false}
  ]
}

Webhooks

Instead of asking again and again, let us call you. Add an HTTPS address on the API page and keep its secret. We send a POST when a scan of your account reaches one of these points, whether it was started through the API or in the workspace:

EventWhen
scan.completedThe report is ready.
scan.failedIt was interrupted, or no report could be prepared.
scan.cancelledCancelled before it started.
scan.action_requiredIt waits for you: credit, verification or spending limit.
webhook.testYou pressed “Send test event”.
{
  "type": "scan.completed",
  "timestamp": "2026-11-25T15:44:02Z",
  "data": {"object": "scan", "id": "0b6f3a52-6f0e-4c51-9f2d-2a7f3d1c8e90", "status": "completed"}
}

data is the complete scan object, shortened here. It never contains findings: download the report with your key.

Check the signature

Events follow Standard Webhooks, so its libraries work as they are. Each request has webhook-id, webhook-timestamp and webhook-signature. Use the raw body, before any JSON parsing.

import base64, hashlib, hmac, time

def verify(secret: str, headers: dict, body: bytes) -> bool:
    event_id, timestamp = headers["webhook-id"], headers["webhook-timestamp"]
    if abs(time.time() - int(timestamp)) > 300:      # five minutes: refuses replays
        return False
    key = base64.b64decode(secret.removeprefix("whsec_"))
    signed = f"{event_id}.{timestamp}.".encode() + body
    expected = "v1," + base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
    return any(hmac.compare_digest(expected, value) for value in headers["webhook-signature"].split())
import { createHmac, timingSafeEqual } from "node:crypto";

export function verify(secret, headers, body) { // body: the raw request text
  const id = headers["webhook-id"], timestamp = headers["webhook-timestamp"];
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; // refuses replays
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = Buffer.from("v1," + createHmac("sha256", key).update(`${id}.${timestamp}.${body}`).digest("base64"));
  return headers["webhook-signature"].split(" ").some((value) => {
    const given = Buffer.from(value);
    return given.length === expected.length && timingSafeEqual(given, expected);
  });
}

Delivery

  • Answer with any 2xx within 15 seconds, then do the work. Redirects are not followed.
  • Otherwise we try again nine times over about three days, with growing delays. 410 Gone turns the webhook off.
  • An event can arrive twice: ignore a webhook-id you already handled.
  • The address must be public, on port 443, with a valid certificate.

CI/CD

RiskRift works with any pipeline that can run a command. A scan can take several hours, so it is not a check to run on every commit. Two patterns work well:

  • On a schedule. Once a week, or the night before a release, scan your staging site and fail the job at the severity you choose.
  • After a deployment. Start the scan with --no-wait, let the pipeline continue, and act on the webhook or on the next scheduled job.

Scan a stable address. Every hostname has to be verified once, so temporary preview addresses that change with each branch don’t fit.

The script

riskrift-scan.sh starts the scan, waits, saves the reports and sets the exit code. It needs bash, curl and jq, and nothing else. Read it, commit it to your repository, or download it and check it:

curl -fsSLo riskrift-scan.sh https://riskrift.com/ci/riskrift-scan.sh
echo "3cee3438f9830a6665c4ab58ff8b4c6a140ac3a6c94b6113c96056c2f1c5941d  riskrift-scan.sh" | sha256sum --check
bash riskrift-scan.sh --target https://staging.example.com/ --i-am-authorized --limit 10 --fail-on high
OptionDescription
--target URLWhat to scan. Requires --i-am-authorized.
--scan IDFollow an existing scan instead.
--limit DOLLARSMost it may cost, 5 to 500. Needed once your free scan is used.
--fail-on SEVERITYcritical, high (default), medium, low, informational or none.
--formats LISTDefault json,sarif,pdf.
--output DIRDefault riskrift-report.
--timeout MINUTESHow long to wait. Default 300.
--on-timeout ACTIONdetach (default) leaves the scan running, finish stops it and takes its report.
--no-waitStart the scan and exit.

Set RISKRIFT_API_KEY in your CI secrets. To test behind a login, add RISKRIFT_LOGIN_USERNAME, RISKRIFT_LOGIN_PASSWORD and, if needed, RISKRIFT_LOGIN_URL. The commit, branch and run number are added to metadata.

Exit codeMeaning
0No finding at or above --fail-on. This does not prove that the site is secure.
1Findings at or above --fail-on.
2Usage or request error.
3The scan failed or was cancelled.
4Still running after --timeout.
5Waiting for you in the workspace.

Findings are recorded automatically and not reviewed by a person. Begin with --fail-on none, read a few reports, then choose the level that should stop your pipeline.

GitHub Actions

name: RiskRift
on:
  workflow_dispatch:
  schedule:
    - cron: "0 1 * * 1"          # Mondays, 01:00 UTC

permissions:
  contents: read
  actions: read
  security-events: write         # only to upload SARIF

concurrency: riskrift-staging    # one scan at a time

jobs:
  scan:
    runs-on: ubuntu-latest
    timeout-minutes: 355         # GitHub-hosted jobs stop at six hours
    steps:
      - uses: actions/checkout@v7
      - name: Get the script
        run: |
          curl -fsSLo riskrift-scan.sh https://riskrift.com/ci/riskrift-scan.sh
          echo "3cee3438f9830a6665c4ab58ff8b4c6a140ac3a6c94b6113c96056c2f1c5941d  riskrift-scan.sh" | sha256sum --check
      - name: Scan staging
        env:
          RISKRIFT_API_KEY: ${{ secrets.RISKRIFT_API_KEY }}
        run: >
          bash riskrift-scan.sh --target https://staging.example.com/ --i-am-authorized
          --limit 10 --fail-on high --timeout 330 --on-timeout detach
      - name: Show findings in the Security tab
        if: always() && hashFiles('riskrift-report/riskrift.sarif') != ''
        uses: github/codeql-action/upload-sarif@v4
        with:
          sarif_file: riskrift-report/riskrift.sarif
          category: riskrift
      - name: Keep the reports
        if: always() && hashFiles('riskrift-report/**') != ''
        uses: actions/upload-artifact@v7
        with:
          name: riskrift-report
          path: riskrift-report/
          retention-days: 30

Remove the Security tab step if code scanning is not enabled for your repository; on private repositories it depends on your GitHub plan. On a public repository, remove “Keep the reports” too: anyone could download them.

GitLab CI

riskrift:
  image: alpine:3
  timeout: 6h
  resource_group: riskrift-staging
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
  before_script:
    - apk add --no-cache bash curl jq
    - curl -fsSLo riskrift-scan.sh https://riskrift.com/ci/riskrift-scan.sh
    - echo "3cee3438f9830a6665c4ab58ff8b4c6a140ac3a6c94b6113c96056c2f1c5941d  riskrift-scan.sh" | sha256sum -c
  script:
    - bash riskrift-scan.sh --target https://staging.example.com/ --i-am-authorized --limit 10 --fail-on high --timeout 340
  artifacts:
    when: always
    access: developer
    expire_in: 30 days
    paths: [riskrift-report/]

Add RISKRIFT_API_KEY as a masked and protected variable. GitLab Ultimate can also read the SARIF file with artifacts:reports:sarif; check the version and plan in GitLab’s documentation.

Jenkins

pipeline {
  agent any
  triggers { cron('H 1 * * 1') }
  options { timeout(time: 6, unit: 'HOURS'); disableConcurrentBuilds() }
  environment { RISKRIFT_API_KEY = credentials('riskrift-api-key') }
  stages {
    stage('RiskRift') {
      steps {
        sh '''
          curl -fsSLo riskrift-scan.sh https://riskrift.com/ci/riskrift-scan.sh
          echo "3cee3438f9830a6665c4ab58ff8b4c6a140ac3a6c94b6113c96056c2f1c5941d  riskrift-scan.sh" | sha256sum --check
          bash riskrift-scan.sh --target https://staging.example.com/ --i-am-authorized --limit 10 --fail-on high
        '''
      }
    }
  }
  post { always { archiveArtifacts artifacts: 'riskrift-report/*', allowEmptyArchive: true } }
}

Any other system works the same way: a secret variable, and one command.

Limits and safety

  • Internet only, for now. Internal networks, VPN-only apps, local environments, private IP addresses and sites that block outside visitors cannot be scanned.
  • Only what you may test. You need control of the hostname and permission for the infrastructure it affects. A key does not change that.
  • Real requests. A scan can create traffic, submit forms, trigger alerts or affect a fragile application. Prefer a staging site with test data and a dedicated test account.
  • Automated findings. They can be wrong or incomplete, and two scans of the same site can differ. A scan does not replace a security specialist, and an empty report is not proof of security.
  • Waiting in line. Up to five scans run at once on the service, and yours starts by itself.

The Terms and the Privacy policy apply to scans started through the API.

Versioning

The version is in the address: /api/v1. Within version 1 we may add endpoints, optional parameters, response fields, error codes, event types and values such as a new status. We do not rename, remove or change the type of anything. An incompatible change would come as version 2, next to this one, and we would email the accounts that use version 1 before retiring it.

The JSON report has its own version, schema_version, with the same rule. SARIF is fixed at 2.1.0.

DateChange
25 November 2026API 1.0: scans, reports in JSON, SARIF and PDF, test mode, webhooks, CI script.

OpenAPI and tools

Import openapi.json in Postman, Insomnia or Bruno, or generate a client in your language with any OpenAPI 3.1 generator. The report is described by its JSON Schema.

Something missing or unclear? Write to hello@riskrift.com.