Skip to main content

Local authority enforcement client for Ratify

Project description

Ratify

Ratify is an authority control plane for AI agents. You define which tool calls an agent may execute autonomously, which require another principal's approval, and which remain reserved.

Ratify Cloud owns Authority Grants, approvals, client identity, and uploaded audit records. Ratify Client runs beside the agent, synchronizes versioned rules, evaluates tool calls locally, and uploads audit batches asynchronously. Normal tool evaluation does not require a per-call Cloud round trip.

See Ratify v1 architecture for the lifecycle and stale rules behavior.

Authority decisions use three terms:

  • Delegated: the agent may execute the action.
  • Requires Approval: execution waits for a Cloud reviewer.
  • Reserved: the agent may not execute the action.

Install

Ratify uses three related names:

  • PyPI package: tryratify
  • CLI command: ratify
  • Python import: ratify_sdk

Install the published package from PyPI:

pip install tryratify

Create an API key

Sign up at tryratify.com/signup. Signup creates an account, a default agent, and an API key. Copy the key when it appears; its secret is shown only once.

Additional keys can be created or revoked from API Keys.

Start Ratify Client

Use the Cloud URL, API key, and agent ID shown during onboarding:

ratify client start \
  --cloud-url https://tryratify.com \
  --api-key '<copied-key>' \
  --agent-id '<agent-id>'

Ratify detects the platform, downloads and verifies the matching client binary, caches it under ~/.cache/ratify/sidecar/<version>/ratify-sidecar, and starts it. The client listens at http://127.0.0.1:8088 by default. The Cloud Clients page shows its heartbeat, current ruleset version, latest published version, account state, and quota state.

Publish an authority rule

Open Authority Grants, publish YAML using the exact fully qualified tool names used by your agent, and wait for the client version to match the published version:

agent: <agent-id>

rules:
- name: Read public data
  tool: custom.read_data
  condition: true
  action: delegated

- name: Publish changes with review
  tool: custom.publish_changes
  condition: true
  action: requires_approval

- name: Keep destructive operations reserved
  tool: custom.destroy_system
  condition: true
  action: reserved

Rule actions are exactly delegated, requires_approval, and reserved.

Run the first governed action

Wrap actual tool entrypoints with Guard. Use stable namespace.action names; the same name must appear in the tool call and Authority Grants.

from ratify_sdk import Guard


def read_data(item: str) -> dict[str, str]:
    return {"item": item, "value": "public"}


guard = Guard(
    agent_id="<agent-id>",
    sidecar_url="http://127.0.0.1:8088",
)
tools = guard.wrap({"custom.read_data": read_data})

result = tools.dispatch({
    "id": "call-1",
    "name": "custom.read_data",
    "input": {"item": "launch-status"},
})

A Delegated call executes locally. A Requires Approval call appears in Cloud and resumes after review. A Reserved call is not executed. Each decision is queued locally and uploaded to Cloud Audit.

Development

Release maintainers should follow the release guide.

go build ./...
go test ./...
python -m pytest sdk/python/tests
python -m build

The optional customer-support demonstration is isolated under examples/demo and is not part of the Ratify product runtime or Python distribution.

Ratify is licensed under the Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tryratify-0.1.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tryratify-0.1.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file tryratify-0.1.1.tar.gz.

File metadata

  • Download URL: tryratify-0.1.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tryratify-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2d3e7ed5ccd5cee25c6b1e68cab28f8f252644ade196814c257be81be8f1c3d8
MD5 92e57481d5c4857ab5d93ffcf1d1d946
BLAKE2b-256 f6c3a40828742a8b02c3f3c2e34b10272ae4ee652e15a55c0aed0e8dbee3d143

See more details on using hashes here.

Provenance

The following attestation bundles were made for tryratify-0.1.1.tar.gz:

Publisher: release.yml on ratify-ai/ratify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tryratify-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tryratify-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tryratify-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec4069c3b1bfcf543287502b24584decb54cfdad0f56719fddbdf2a2ef09430c
MD5 fce42a65ed821f33bf0e5d35042147f5
BLAKE2b-256 de2a8041961067a7cb4e86fc7cb7ed6f164cd601617fc9a2190732ef3a7cb0f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tryratify-0.1.1-py3-none-any.whl:

Publisher: release.yml on ratify-ai/ratify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page