Skip to main content

Continuous behavioral verification for AI agents in production — detect drift, clones, and prompt injection.

Project description

metalins

Continuous behavioral verification for AI agents in production.

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.2.tar.gz (35.3 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.2-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metalins-0.4.2.tar.gz
  • Upload date:
  • Size: 35.3 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.2.tar.gz
Algorithm Hash digest
SHA256 0d71f9e922802b3a2be517af0d8b5ec8ea31dca6ffd9e5aae44ff4a7d4998a24
MD5 b3908232fe760b5e8a3b8a2dabb4e7bb
BLAKE2b-256 04b11893c0d3bb085354e6a7cec5945589667863b6daa95ea707a7e539ae847f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metalins-0.4.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed9012b622f4b721e45d75f81960567a1ecf78d132a1061463a95fd3c6500a93
MD5 a01db757f9f03b5ef271469fbc26157b
BLAKE2b-256 6fc45eeb0d0772484c0d5b7bb7aa4dc3574dcf2e4d153334b0279242404516a0

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