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.1.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.1-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metalins-0.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7b4a386c4cdd0936e13e43450b336031115479b3d56488327bbdbe360ef67038
MD5 6251701944c6d0f7cef753571c7d3086
BLAKE2b-256 fdd623d475db983fe4a6830799fe71f0a9960c48aad7eeffe8f5034ce618e87e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metalins-0.4.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12740075e9d2128824c94c2e324f9d04768ad381f52b817a46a235be2856846f
MD5 651e7f767c7245332935b32712706a34
BLAKE2b-256 b9f8c9902cdb6d3b57b6daa9d86f89da6c1bb5accb45778db1214bfd8665738d

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