Skip to main content

SDK for Metalins — identity verification for AI agents.

Project description

metalins

Zero Trust identity verification for AI agents.

Your agents in production are black boxes. Metalins verifies they're still the same agents you deployed — same model, same behavior, continuously. It's the behavioral verification layer in the Zero Trust stack for AI agents.

How it works

  1. The SDK hashes your agent's inputs and outputs locally — raw prompts and responses never leave your infrastructure.
  2. Signed hashes are sent to api.metalins.ai, where the behavioral engine runs.
  3. The engine returns a continuous verification status: verified, caution, or not_verified.

Your data stays in your infra. We only see fingerprints.

Install

pip install metalins

Quick start

Three lines to start verifying your agent:

import metalins

agent = metalins.Agent(api_key="ml_live_...", name="my-agent")
agent.start()

# Log each turn — hashing happens locally, automatically
agent.log(input=user_message, output=agent_reply)

# Check verification status at any time
status = agent.get_status()  # "verified" | "caution" | "not_verified"

Or as a context manager:

with metalins.Agent(api_key="ml_live_...", name="my-agent") as agent:
    agent.log(input=user_message, output=agent_reply)

Get your API key at metalins.ai.

Integrations

LangChain

from metalins import Agent
from metalins.integrations.langchain import MetalinsCallbackHandler

agent = Agent(api_key="ml_live_...", name="my-bot").start()
handler = MetalinsCallbackHandler(agent)

chain.invoke(user_input, config={"callbacks": [handler]})

Every chain and LLM call is logged automatically — no manual agent.log() needed.

FastAPI / Starlette

import metalins
from metalins.integrations.fastapi import MetalinsMiddleware

agent = metalins.Agent(api_key="ml_live_...", name="my-api").start()
app.add_middleware(MetalinsMiddleware, agent=agent)

Every request/response pair is logged automatically. Bodies are hashed locally and never buffered in full (1 MiB cap by default). Skip noisy endpoints with exclude_paths=["/health"].

Anthropic SDK

import metalins

agent = metalins.Agent(api_key="ml_live_...", name="my-claude-agent").start()

with metalins.trace(agent):
    response = client.messages.create(...)

Or use the @metalins.monitor decorator on any function that calls the Anthropic SDK.

What leaves your infrastructure

Only hashed fingerprints — never raw text:

What we receive What stays with you
SHA-256 hash of input Raw prompt text
SHA-256 hash of output Raw response text
Timestamp + agent ID Your users' data
HMAC-signed event chain Your model config

The behavioral engine compares fingerprint patterns over time. It does not reconstruct your prompts or responses.

State persistence

The SDK persists the agent session (ID, secret, hash chain) to ~/.metalins/<name>.json with 0600 permissions by default. To store it elsewhere — a database, a secrets manager — pass any object with load() and save():

agent = metalins.Agent(api_key="ml_live_...", name="my-bot", store=my_store)

License

Apache 2.0. See LICENSE.

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

metalins-0.4.0.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

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

metalins-0.4.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file metalins-0.4.0.tar.gz.

File metadata

  • Download URL: metalins-0.4.0.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for metalins-0.4.0.tar.gz
Algorithm Hash digest
SHA256 039e43ba0a0d23bd6725b05f703fdd62a8867ad2ec8239c437ed88eae5cb9ae1
MD5 5dd7e83f8d0cf867abd0a19c94d98e94
BLAKE2b-256 aafc63964545acbbd1e7ef94b77ab54b0e61c4ebe5d540fb395a74e63a481f62

See more details on using hashes here.

File details

Details for the file metalins-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: metalins-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for metalins-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e189e21a28b511197493886106ddb15e740b3b0b7b6d39d6ec57ec662130a39
MD5 75c26af3dc0e9392c369e5606366c43b
BLAKE2b-256 bde9c29f1e0b8a1c75e4bf0db5b998c51fa00c7ea2329f9b748e7536eaa03f5d

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