API reference.
Call the Rivex API with an API key to harden Dockerfiles and to read your runs, policies and organizations.
Base URL.
The API is at https://api.rivexsecurity.com. Every path starts with /v1, except /health. Requests and responses are JSON, and times are in UTC.
Authentication.
Send your API key in the X-API-Key header of every request. You create a key on the API keys page. You need a verified email address, and the page shows the key once. The steps are in the web app guide.
A key acts as the user who created it: it sees that user's runs, policies and organizations. A key cannot create, list or revoke keys. A revoked key is refused with 401.
Put the API address and the key in two shell variables. Replace <your-api-key> with your key. Every example on this page uses the two variables.
export RIVEX_API_URL=https://api.rivexsecurity.com
export RIVEX_API_KEY='<your-api-key>' A request with a body also needs the header Content-Type: application/json.
Rate limits and the build budget.
Each API key can make 50 requests in a calendar month. The month follows UTC. A request counts when it sends the key, whatever its method, and most requests that end in an error count too. Once the key has used them up, the API answers 429 with {"detail": "Rate limit exceeded"} until the next month starts.
POST /v1/harden and POST /v1/k8s/harden can also answer 429 when your account has used up its build budget. That answer has a Retry-After header: wait that many seconds before you try again.
Harden runs have no monthly limit. Builds verified in the sandbox do: each plan has a number of them per UTC calendar month, and GET /v1/usage explains how they count.
Errors.
An error is a JSON object with a detail field that says what went wrong:
{"detail": "Run not found"} When the body or a parameter of the request is not valid, the status is 422 and detail is a list. Each item has a type, a loc that points at the field, and a msg:
{"detail": [{"type": "missing", "loc": ["body", "dockerfile"], "msg": "Field required"}]} The routes on this page answer with these status codes:
200: the request worked, and the body is the result.201: the policy was created.204: the run or the policy was deleted. The response has no body.400: the Dockerfile cannot be parsed, or the base image named incontextis not a valid image reference.401: the key is missing, not valid or revoked.403: your role in the organization does not allow this.404: the run, policy or organization does not exist, or it is not yours.409: you already have a policy with that name.422: the body or a parameter is not valid.429: the key has used its requests for the month, or the build budget is used up.500: the server failed.504: hardening took too long.
Check that the API is up.
GET /health.
Answers without a key. Use it to check that the API is reachable.
curl -sS -f "$RIVEX_API_URL/health" {"status": "ok"} Harden.
POST /v1/harden.
Hardens a Dockerfile. The response has the hardened file and one finding for each thing Rivex changed or reports. The body has these fields:
dockerfile: the Dockerfile as one string. Required.policy_id: theidof one of your policies, or of a policy of an organization you belong to. Optional.context: facts about the build and the deployment, as the context reference describes them. Optional.registry_auth: up to 4 entries, each withhost,usernameandsecret, for base images on a private registry. Rivex uses them only for this request, and never stores or returns them. Needs the registry credentials feature, which the server operator turns on. Optional. See registry credentials.build_context: your project files for build verification, as base64 of a gzip-compressed tar archive. The limits are 20 MiB compressed, 200 MiB unpacked and 20,000 entries; over a limit the API answers413. The archive may hold only files, folders and symbolic links that stay inside it, with no.., absolute path, setuid or setgid bit, noDockerfileat the top and no.rivexfolder; otherwise the API answers422. Rivex uses the files only for this build, deletes them when the build ends and never stores or logs them. When the server is already unpacking as many build contexts as it allows, it answers503: try again shortly. When build verification is off on the server, only the size is checked and the files are ignored. Optional.rivex harden --build-contextbuilds this field for you, see the CLI guide.verify_build:falseto skip build verification for this run: nothing is built, no verified build is used, andbuild_contextis only checked for size. Default:true. Optional.
curl -sS -f -X POST \
-H "X-API-Key: $RIVEX_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"dockerfile": "FROM ubuntu\nEXPOSE 8080\nMAINTAINER a@b.c\n"}' \
"$RIVEX_API_URL/v1/harden" {
"hardened_dockerfile": "FROM ubuntu\nEXPOSE 8080\nMAINTAINER a@b.c\nRUN (getent group 10001 >/dev/null 2>&1 || groupadd -r -g 10001 nonroot 2>/dev/null || addgroup -S -g 10001 nonroot) && (getent passwd 10001 >/dev/null 2>&1 || useradd -r -u 10001 -g 10001 -s /sbin/nologin nonroot 2>/dev/null || adduser -S -D -H -u 10001 -G nonroot nonroot) || (echo \"rivex: could not create user nonroot with UID and GID 10001; set USER to the UID:GID of an existing non-root user\" >&2 && exit 1)\nUSER 10001:10001\n",
"findings": [
{
"rule": "non-root-user",
"severity": "critical",
"message": "No USER instruction in final stage; created user nonroot with UID 10001 and GID 10001 and set USER 10001:10001",
"stage_idx": 0,
"injected": true,
"line_start": 1,
"line_end": 1
}
],
"suggested_dockerignore": [".git/"],
"disabled_rules": []
} injected is true when Rivex changed the file for that finding, and false when it only reports it. The response also carries the SBOM, the attestation and a status for each, which the web app guide explains. attestation is a Sigstore bundle with a signed SLSA Provenance v1 statement for the hardened Dockerfile. The statement holds the digests of both Dockerfiles; for each finding, only its rule ID, its line numbers and whether Rivex changed the line, never the finding text; the engine version, the policy's disabled rules, the run ID and the start and end times; Verify a Rivex attestation checks it with cosign verify-blob-attestation. It has no run ID: to find the run, call GET /v1/runs, or read the invocationId of the attestation, which is the run ID. No run is stored when your retention mode is ephemeral, or if saving the run fails; the attestation still names that ID.
verification_status is one of verified, failed, disabled, not_verifiable_offline, needs_build_context, allowance_used, skipped and not_enabled. not_verifiable_offline comes with verification_offline_line and verification_offline_host: a step needs a host the sandbox can't reach. needs_build_context comes with verification_context_line, the line of the first COPY or ADD of project files, when the request had no build_context. allowance_used comes with verification_allowance_limit, the number of verified builds this month (all used), and verification_allowance_renews_on, the date they renew. skipped means the request had verify_build set to false. In these four cases nothing was built, which is not a failure. not_enabled means build verification (or SBOM generation) is available on this server but not turned on for the run's organization or personal workspace; nothing was built (or generated), which is not a failure. disabled (for both verification_status and sbom_status) means the feature is turned off on this server. The response also has org_id: the UUID of the organization whose policy the run used, or null for a personal policy or no policy. Clients use it to word not_enabled: for an organization or for your account.
failed comes with verification_failure when Rivex could read why from the build's log: line, the line of the hardened Dockerfile whose step failed, exit_code (null when the step ran no command, as a COPY of a missing file), errors, rivex_step, true when Rivex added or changed that line, needs_files, true when the Dockerfile copies no project files and the errors point at missing ones, and mode. With mode log, errors holds up to three lines of the build's output (200 characters each, with anything that looks like a token or password removed, and Rivex's internal cache addresses replaced). With mode catalog, the build installed packages through Rivex's caches, so it ran with a short-lived sandbox credential, and Rivex never returns its output: errors holds only Rivex's own sentences for the errors it recognizes, and is empty for others. verification_failure is null when the log could not be read within a few seconds; the run is still failed. Only whoever can see the run sees it.
sbom_status is one of ok, disabled, unresolved, blocked, busy, failed, timeout, too_large and not_enabled. not_enabled means build verification (or SBOM generation) is available on this server but not turned on for the run's organization or personal workspace; nothing was built (or generated), which is not a failure. too_large means the base image is over the server's size limit for an SBOM, so sending the same request again does not help. Its sbom_detail is <ref>[, <N> MB compressed[, <slim ref>]]: the image, then its compressed size when Rivex could read it, then a -slim tag of an official Docker Hub image when one exists.
attestation_status is one of ok, disabled, failed, timeout and secret_in_output. secret_in_output comes with attestation_secret_line (the hardened file's line, or null) and means the run was not signed because the hardened file still contains a secret that Rivex redacts, so attestation and attestation_format are null. Nothing was signed or published. Remove the secret and run again.
POST /v1/k8s/harden.
Hardens a Kubernetes manifest. The body has a manifest field with the YAML as one string, and it takes the same optional context as POST /v1/harden.
curl -sS -f -X POST \
-H "X-API-Key: $RIVEX_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"manifest": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: web\nspec:\n selector:\n matchLabels:\n app: web\n template:\n metadata:\n labels:\n app: web\n spec:\n containers:\n - name: web\n image: nginx:1.27\n"}' \
"$RIVEX_API_URL/v1/k8s/harden" {
"findings": [
{
"rule": "security-context",
"severity": "high",
"message": "Injected securityContext hardening into container 'web'",
"resource": "Deployment/web",
"container": "web",
"injected": true
}
],
"error": null
} The response also has hardened_manifest, the hardened YAML as one string, which the example leaves out. When hardening fails, error says why and hardened_manifest is empty. That is also the answer of a server where Kubernetes hardening is turned off: the status is still 200, and error is K8s hardening disabled.
Rules.
GET /v1/rules.
Lists every hardening rule with its id and a display name. The IDs are what a policy's disabled_rules holds.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/rules" [
{"id": "non-root-user", "display_name": "Non-root user enforcement"}
] Runs.
A run is the record of one POST /v1/harden call. You see only the runs you started. Rivex stores no run when the account or the organization is set to discard them, as the web app guide describes.
In the examples, <run-id> stands for the id of a run, which you read from GET /v1/runs.
GET /v1/runs.
Lists your runs, newest first, 100 at most.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/runs" [
{
"id": "3f1c9a52-7b0e-4d6a-9c1f-2e8a5d4b7c10",
"created_at": "2026-01-15T09:30:00.123456",
"policy_id": null,
"findings_count": 8,
"input_image": "ubuntu"
}
] GET /v1/runs/{run_id}.
Returns one run with everything it produced: the Dockerfile you sent, the hardened file and the findings.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/runs/<run-id>" {
"id": "3f1c9a52-7b0e-4d6a-9c1f-2e8a5d4b7c10",
"created_at": "2026-01-15T09:30:00.123456",
"policy_id": null,
"input_dockerfile": "FROM ubuntu\nEXPOSE 8080\nMAINTAINER a@b.c\n",
"findings": [
{
"rule": "non-root-user",
"severity": "critical",
"message": "No USER instruction in final stage; created user nonroot with UID 10001 and GID 10001 and set USER 10001:10001",
"stage_idx": 0,
"injected": true
}
],
"disabled_rules": []
} The response also has hardened_dockerfile, which the example leaves out. When the run has an attestation, attestation_format is sigstore_bundle, or legacy for a run signed before the standard format: a JSON object with the Sigstore bundle in bundle and the signed statement in statement. attestation_matches_download is false when the stored hardened_dockerfile has secrets redacted: the attestation covers the file returned when the run was hardened, so the stored copy will not verify. It is null when the run has no attestation.
GET /v1/runs/{run_id}/report.
Returns a compliance report for one run. Each finding names the CIS controls and the SLSA level it relates to. sbom and attestation say whether the run has one, with a SHA-256 hash when it does.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/runs/<run-id>/report" {
"run_id": "3f1c9a52-7b0e-4d6a-9c1f-2e8a5d4b7c10",
"created_at": "2026-01-15T09:30:00.123456",
"findings": [
{
"rule": "non-root-user",
"severity": "critical",
"cis_controls": ["CIS-DI-0001"],
"slsa_level": "SLSA-L1"
}
],
"sbom": {"present": false, "format": null, "sha256": null},
"attestation": {"present": false, "bundle_sha256": null},
"cve_diff_summary": {"fixed": 0, "introduced": 0, "unchanged": 0}
} DELETE /v1/runs/{run_id}.
Deletes one run for good. The answer is 204 with no body.
curl -sS -f -X DELETE -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/runs/<run-id>" Policies.
A policy is a named list of rules to switch off. To use one, pass its id as policy_id to POST /v1/harden. GET /v1/policies lists only the policies you created. The policies of an organization come from GET /v1/orgs/{org_id}/policies.
In the examples, <policy-id> stands for the id of a policy, and <org-id> for the id of an organization, which you read from GET /v1/orgs.
POST /v1/policies.
Creates a policy. name is required and can be up to 64 characters long. disabled_rules is a list of rule IDs from GET /v1/rules. The answer is 201. A name you already use is refused with 409, and an unknown rule ID with 422.
curl -sS -f -X POST \
-H "X-API-Key: $RIVEX_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name": "api-example", "disabled_rules": ["latest-tag"]}' \
"$RIVEX_API_URL/v1/policies" {
"id": "5d7e9f1a-2b4c-4e6f-8a0b-1c3d5e7f9a2b",
"user_id": "8a2d4c6e-1f3b-4a5c-8d7e-9b0a1c2d3e4f",
"org_id": null,
"name": "api-example",
"disabled_rules": ["latest-tag"],
"created_at": "2026-01-15T09:30:00.123456",
"updated_at": "2026-01-15T09:30:00.123456"
} GET /v1/policies.
Lists the policies you created, oldest first.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/policies" [
{
"id": "5d7e9f1a-2b4c-4e6f-8a0b-1c3d5e7f9a2b",
"org_id": null,
"name": "api-example",
"disabled_rules": ["latest-tag"]
}
] GET /v1/policies/{policy_id}.
Returns one policy you created.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/policies/<policy-id>" {
"id": "5d7e9f1a-2b4c-4e6f-8a0b-1c3d5e7f9a2b",
"org_id": null,
"name": "api-example",
"disabled_rules": ["latest-tag"]
} PUT /v1/policies/{policy_id}.
Changes a policy you created. Send name, disabled_rules or both. A field you leave out keeps its value, and disabled_rules replaces the whole list.
curl -sS -f -X PUT \
-H "X-API-Key: $RIVEX_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"disabled_rules": ["latest-tag", "healthcheck"]}' \
"$RIVEX_API_URL/v1/policies/<policy-id>" {
"id": "5d7e9f1a-2b4c-4e6f-8a0b-1c3d5e7f9a2b",
"name": "api-example",
"disabled_rules": ["latest-tag", "healthcheck"],
"updated_at": "2026-01-15T09:45:00.123456"
} DELETE /v1/policies/{policy_id}.
Deletes a policy you created. The answer is 204 with no body.
curl -sS -f -X DELETE -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/policies/<policy-id>" GET /v1/orgs/{org_id}/policies.
Lists the policies of an organization you belong to, oldest first.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/orgs/<org-id>/policies" [
{
"id": "5d7e9f1a-2b4c-4e6f-8a0b-1c3d5e7f9a2b",
"org_id": "c4a6e8b0-3d5f-4b7a-9c1e-0f2a4b6c8d1e",
"name": "team-default",
"disabled_rules": ["healthcheck"]
}
] GET /v1/orgs/{org_id}/policies/{policy_id}.
Returns one policy of an organization you belong to.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/orgs/<org-id>/policies/<policy-id>" {
"id": "5d7e9f1a-2b4c-4e6f-8a0b-1c3d5e7f9a2b",
"org_id": "c4a6e8b0-3d5f-4b7a-9c1e-0f2a4b6c8d1e",
"name": "team-default",
"disabled_rules": ["healthcheck"]
} Organizations.
With a key you can read the organizations you belong to. The routes under /v1/orgs that create, change or delete something do not take a key: they need a signed-in session. Two things such a session can do are not in the web app guide: an admin can remove another admin, and an owner can delete the organization.
GET /v1/orgs.
Lists the organizations you belong to. The list is empty when you belong to none.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/orgs" [
{
"id": "c4a6e8b0-3d5f-4b7a-9c1e-0f2a4b6c8d1e",
"name": "acme",
"created_at": "2026-01-15T09:30:00.123456",
"retention_mode": "persistent"
}
] GET /v1/orgs/{org_id}.
Returns one organization you belong to.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/orgs/<org-id>" {
"id": "c4a6e8b0-3d5f-4b7a-9c1e-0f2a4b6c8d1e",
"name": "acme",
"created_at": "2026-01-15T09:30:00.123456",
"retention_mode": "persistent"
} GET /v1/orgs/{org_id}/members.
Lists the members of an organization you belong to. role is owner, admin or member.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/orgs/<org-id>/members" [
{
"user_id": "8a2d4c6e-1f3b-4a5c-8d7e-9b0a1c2d3e4f",
"org_id": "c4a6e8b0-3d5f-4b7a-9c1e-0f2a4b6c8d1e",
"role": "owner",
"joined_at": "2026-01-15T09:30:00.123456"
}
] GET /v1/orgs/{org_id}/audit-log.
Lists what happened in an organization, newest first. Only owners and admins can read it: a member gets 403. The query parameters limit (1 to 1000, 100 when you leave it out) and offset page through the entries, and action, actor, since and until filter them.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/orgs/<org-id>/audit-log" [
{
"id": "1e3a5c7e-9b2d-4f4a-8c6e-0a2c4e6a8c0e",
"org_id": "c4a6e8b0-3d5f-4b7a-9c1e-0f2a4b6c8d1e",
"actor_user_id": "8a2d4c6e-1f3b-4a5c-8d7e-9b0a1c2d3e4f",
"action": "org.created",
"target_user_id": null,
"timestamp": "2026-01-15T09:30:00.123456"
}
] GET /v1/usage.
Returns the plan of your personal workspace, and how many of its verified builds you used this month. Runs with no organization count here.
A personal workspace is on the Individual plan, with 5 verified builds a month. An organization is on the Team plan, with 50, unless Rivex set another number for it. A run counts against an organization when it uses one of the organization's policies; otherwise against your personal workspace. An organization's count is kept under the account that created it, so changing roles doesn't move it and deleting the organization and creating a new one doesn't reset it. An account can own one organization. One verified build is one build the sandbox may have started, whatever its result. GitHub App checks never build in the sandbox. A run where nothing was built uses none. When this month's verified builds are used up, POST /v1/harden still answers 200 with the hardened Dockerfile and the findings, and verification_status is allowance_used. They renew on the first day of the next month (UTC). Only Rivex changes a plan. verification_available is false when build verification is off on the server.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/usage" {
"plan": "individual",
"verified_builds_used": 1,
"verified_builds_limit": 5,
"renews_on": "2026-12-01",
"verification_available": true
} GET /v1/orgs/{org_id}/subscription.
Returns the plan of an organization you belong to, and how many of its verified builds the organization used this month. Any member can read it. Only Rivex changes a plan: PATCH on this route answers 403 for everyone.
curl -sS -f -H "X-API-Key: $RIVEX_API_KEY" "$RIVEX_API_URL/v1/orgs/<org-id>/subscription" {
"org_id": "c4a6e8b0-3d5f-4b7a-9c1e-0f2a4b6c8d1e",
"plan": "team",
"created_at": "2026-01-15T09:30:00.123456Z",
"updated_at": "2026-01-15T09:30:00.123456Z",
"verified_builds_used": 12,
"verified_builds_limit": 50,
"renews_on": "2026-12-01",
"seats_used": 2,
"verification_available": true
} Routes used by the web app.
These routes serve the web app and sign-in. None of them takes an API key, and they can change without notice.
- Sign-in and sessions:
POST /v1/auth/register,POST /v1/auth/jwt/login,POST /v1/auth/jwt/logout,POST /v1/auth/cookie/login,POST /v1/auth/cookie/logout,GET /v1/auth/session,GET /v1/auth/sessions,DELETE /v1/auth/sessions/{session_id},POST /v1/auth/logout-all,GET /v1/auth/oauth/google/authorize,GET /v1/auth/oauth/google/callback,GET /v1/auth/oauth/google/associate/authorize,GET /v1/auth/oauth/google/associate/callback - Account:
GET /v1/auth/users/me,PATCH /v1/auth/users/me,POST /v1/auth/password-change,POST /v1/auth/request-verify-token,POST /v1/auth/verify,POST /v1/auth/forgot-password,POST /v1/auth/reset-password - API keys:
GET /v1/auth/api-keys,POST /v1/auth/api-keys,DELETE /v1/auth/api-keys/{key_id},POST /v1/api-keys - Organizations and invitations:
POST /v1/orgs,DELETE /v1/orgs/{org_id},PATCH /v1/orgs/{org_id}/settings,POST /v1/orgs/{org_id}/members,DELETE /v1/orgs/{org_id}/members/me,PATCH /v1/orgs/{org_id}/members/{uid},DELETE /v1/orgs/{org_id}/members/{uid},POST /v1/orgs/{org_id}/invitations,GET /v1/invitations,POST /v1/invitations/{token}/accept,POST /v1/invitations/{token}/decline - Organization policies:
POST /v1/orgs/{org_id}/policies,PUT /v1/orgs/{org_id}/policies/{policy_id},DELETE /v1/orgs/{org_id}/policies/{policy_id} - Billing:
GET /v1/billing/plans,PATCH /v1/orgs/{org_id}/subscription - Waitlist:
POST /v1/waitlist - Context questions:
POST /v1/harden/questions - Registry credentials:
GET /v1/registry-credentials,POST /v1/registry-credentials,DELETE /v1/registry-credentials/{credential_id},GET /v1/orgs/{org_id}/registry-credentials,POST /v1/orgs/{org_id}/registry-credentials,DELETE /v1/orgs/{org_id}/registry-credentials/{credential_id}POST takes host, namespace, username and secret, and the responses carry namespace (null for a credential saved before namespaces, which runs do not use).