Skip to main content

argus-sdk

Python SDK for Argus — AI agent observability and security monitoring.

Argus captures every LLM call, tool call, and action your agent takes, scores them for risk in real time, and surfaces alerts for dangerous operations, PII exposure, secret leakage, and prompt injection.

Installation

pip install argus-agent-sdk

With LangChain support:

pip install "argus-agent-sdk[langchain]"

Quick Start

from argus_sdk import ArgusClient

argus = ArgusClient(
    api_key="sk_live_...",   # from your Argus dashboard
    actor_id="my-agent",     # unique ID for this agent
)

# Track an LLM call
argus.llm_call(
    input_text=prompt,
    output_text=response,
    input_tokens=512,
    output_tokens=128,
)

# Track a tool call
argus.tool_call(
    action_type="search_web",
    input_text=query,
    output_text=result,
)

# Track any other action
argus.action(
    action_type="file_write",
    payload={"path": "/tmp/output.txt"},
)

LangChain Integration

Drop ArgusLangChainHandler into any chain or agent — it automatically captures all LLM calls and tool calls:

from argus_sdk import ArgusClient, ArgusLangChainHandler
from langchain.chains import LLMChain

argus = ArgusClient(api_key="sk_live_...", actor_id="my-agent")
handler = ArgusLangChainHandler(argus)

chain = LLMChain(llm=llm, prompt=prompt, callbacks=[handler])
result = chain.run("...")
# LLM calls and tool calls are automatically audited

OpenAI Wrapper

Wrap your OpenAI client to audit all chat.completions.create() calls with zero changes to your application code:

from openai import OpenAI
from argus_sdk import ArgusClient, wrap_openai

client = wrap_openai(
    OpenAI(),
    ArgusClient(api_key="sk_live_...", actor_id="my-agent"),
)

# All calls below are automatically audited
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
)

Workflow Correlation

Group related events into a workflow chain using correlation_id:

import uuid

correlation_id = str(uuid.uuid4())

argus.llm_call(input_text="Plan the task", correlation_id=correlation_id)
argus.tool_call(action_type="read_file", correlation_id=correlation_id)
argus.tool_call(action_type="write_file", correlation_id=correlation_id)
argus.llm_call(output_text="Done", correlation_id=correlation_id)

Argus groups these into a single workflow run and computes chain-level risk (peak score, cumulative score, escalation detection).

API Reference

ArgusClient(api_key, actor_id, base_url=...)

Parameter Type Required Description
api_key str ✓ Your Argus API key (sk_live_...)
actor_id str ✓ Unique identifier for this agent
base_url str Argus deployment URL (default: https://app.argus.ai)

argus.llm_call(...)

Parameter Type Description
input_text str Prompt sent to the model
output_text str Model response
input_tokens int Prompt token count
output_tokens int Completion token count
correlation_id str Workflow chain ID
payload dict Arbitrary metadata

argus.tool_call(...) / argus.action(...)

Parameter Type Description
action_type str Name of the tool or action (e.g. file_delete, search_web)
input_text str Input to the tool
output_text str Output from the tool
correlation_id str Workflow chain ID
payload dict Arbitrary metadata

All methods return the parsed JSON response dict or None on failure. Errors are printed as warnings and never raise — Argus is designed to be non-blocking in production.

Self-Hosted

Point the SDK at your own Argus deployment:

argus = ArgusClient(
    api_key="sk_live_...",
    actor_id="my-agent",
    base_url="https://argus.yourcompany.com",
)

Requirements

  • Python ≥ 3.9
  • requests ≥ 2.28
  • langchain ≥ 0.1.0 (optional, only needed for ArgusLangChainHandler)

License

MIT

Metadata

Release files for argus-agent-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argus-agent-sdk 0.1.0
File Size Uploaded
argus_agent_sdk-0.1.0.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for argus-agent-sdk 0.1.0
File Interpreter ABI Platform
argus_agent_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / argus_agent_sdk-0.1.0.tar.gz

Download URL argus_agent_sdk-0.1.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3c885d89c8cf04d25c7a3b4c3e295b06aa22bdad935ad40a9aef14a9fc48cfca
BLAKE2b-256 checksum
How to use checksums
26bbf2d48140928c677aef9faff6c3bc6eb16ce42234d205e0625bdab9624ff3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / argus_agent_sdk-0.1.0-py3-none-any.whl

Download URL argus_agent_sdk-0.1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
933e9b0d93de2545ec67a1d270f16d4a16546bf15a0b68c7b9bf9635623934b6
BLAKE2b-256 checksum
How to use checksums
2aa38c9b23a8059ef975e4c37bc0b3eace0b7e77e3c48d829a490ca95062091e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page