Skip to main content

Self-hosted credential infrastructure for autonomous agents. Server-side injection keeps secrets out of agent memory.

Project description

Clavis

Self-Hosted Credential Infrastructure for Autonomous Agents

Your AI agents need API keys, OAuth tokens, and wallet keys.
Hardcoding them = one prompt injection away from disaster.

Clavis stores credentials server-side and injects them at runtime.
Your agents never see the secrets.

Installation

pip install clavis

Quick Start

from clavis import ClavisClient

client = ClavisClient(
    api_key="your-jwt-token",       # from POST /v1/auth/login
    base_url="https://your-clavis-instance.com"
)

# Secure call — credential injected server-side, never touches agent memory
response = await client.call(
    "stripe",
    "GET",
    "https://api.stripe.com/v1/balance"
)
print(response["body"])  # {"object": "balance", ...}

# Check credential health without making external calls
status = await client.check_credentials("stripe")
# {"valid": True, "status": "healthy", "expires_in": 3542}

# Proxy a request (path-based, credential injected server-side)
response = await client.proxy(
    "openai",
    "POST",
    "/v1/chat/completions",
    body={"model": "gpt-4o", "messages": messages}
)

Why Clavis

Hardcoded secrets Clavis
Agent sees raw key Yes No
Prompt injection risk High Eliminated
Token auto-refresh Manual Automatic
Audit log None Every request
Rate limiting Manual Built-in
Self-hostable Yes

Security Model

clavis.call() is the core primitive. When your agent calls it:

  1. Clavis fetches the credential from its encrypted vault
  2. Injects it into the upstream HTTP request server-side
  3. Returns only the API response — no credential ever leaves the server

Even a fully compromised agent cannot exfiltrate credentials it never received.

Features

  • call() — Server-side credential injection; agent never sees raw secrets
  • proxy() — Path-based proxying with automatic auth
  • check_credentials() — Dry-run health check; no external calls made
  • get_token() — Retrieve a valid token for custom auth flows
  • Encrypted credentials at rest (Fernet)
  • Automatic OAuth token refresh
  • Redis-backed rate limiting (cross-agent)
  • Full audit log on every auth event
  • MCP server for Claude Desktop integration

Self-Hosting

Clavis is fully self-hostable. See clavisagent.com/docs/mcp.html for setup.

License

MIT

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

clavis-0.2.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

clavis-0.2.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file clavis-0.2.1.tar.gz.

File metadata

  • Download URL: clavis-0.2.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for clavis-0.2.1.tar.gz
Algorithm Hash digest
SHA256 60510a93bc5bef269be1165747df52513ff244bad8183663e6bab06b3c0e90a1
MD5 ce371590f9a9d0054df5c83eb274a364
BLAKE2b-256 6b6631f6afac999cbd44538970c85c052a2ab64f65ef58bb8400ef1115cd7281

See more details on using hashes here.

File details

Details for the file clavis-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: clavis-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for clavis-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b56ce6aa21ac03bf00d3462636b15350f8bd5ca91efae14c492bd8532002d05
MD5 f8b1c5ed3119dd5311cf7a9ee4d4abdd
BLAKE2b-256 a9c4118aa1e1ec3bdaaef0eaf7d94c525c9f48a23c2c9ca335919c9235f24db7

See more details on using hashes here.

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