Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vaultak.com/llms.txt

Use this file to discover all available pages before exploring further.

Installation

pip install vaultak

Initialization

from vaultak import Vaultak, ActionType, KillSwitchMode

vt = Vaultak(
    api_key="vtk_your_api_key_here",
    allowed_action_types=[ActionType.FILE_READ, ActionType.API_CALL],
    allowed_resources=["/tmp/*", "/data/readonly/*"],
    blocked_resources=["prod.*", "*.env"],
    max_actions_per_minute=20,
    max_risk_score=0.7,
    mode=KillSwitchMode.PAUSE
)

Parameters

ParameterTypeDefaultDescription
api_keystrrequiredYour Vaultak API key
modeKillSwitchModeALERTResponse mode when violation occurs
allowed_action_typeslistNone (all allowed)Whitelist of permitted action types
allowed_resourceslistNone (all allowed)Glob patterns for permitted resources
blocked_resourceslist[]Glob patterns for blocked resources
max_actions_per_minuteint60Rate limit for agent actions
max_risk_scorefloat1.0Hard ceiling on risk score
risk_thresholdfloat0.7Score that triggers the response mode
rollback_limitint5Max actions to reverse in ROLLBACK mode

Action Types

ValueDescription
ActionType.FILE_READReading a file
ActionType.FILE_WRITEWriting to a file
ActionType.FILE_DELETEDeleting a file
ActionType.API_CALLExternal API request
ActionType.DATABASE_QUERYReading from a database
ActionType.DATABASE_WRITEWriting to a database
ActionType.CODE_EXECUTIONExecuting code
ActionType.NETWORK_REQUESTNetwork communication

Response Modes

KillSwitchMode.ALERT     # Log and notify only (default)
KillSwitchMode.PAUSE     # Halt agent, await approval
KillSwitchMode.ROLLBACK  # Reverse last N actions and pause

vt.monitor()

Context manager that wraps your entire agent session.
with vt.monitor("my-agent"):
    pass

vt.log_action()

Explicitly log a single agent action.
vt.log_action(
    agent_id="my-agent",
    action_type="file_delete",
    resource="/data/sensitive.csv",
    payload={"reason": "cleanup"}
)

5-Dimensional Risk Scoring

Every action is scored across five dimensions:
DimensionDescription
Action severityHow destructive is this action type?
Resource sensitivityHow sensitive is the target resource?
Payload anomalyDoes the payload deviate from baseline?
FrequencyIs the agent acting unusually fast?
ContextDoes this action fit the agent’s normal pattern?

REST API

All endpoints require your API key in the header:
x-api-key: vtk_your_api_key_here

POST /api/check

Pre-execution risk check. Returns decision before action runs.
curl -X POST https://vaultak.com/api/check
  -H "x-api-key: vtk_your_api_key_here"
  -H "Content-Type: application/json"
  -d '{"agent_id": "my-agent", "action_type": "file_delete", "resource": "/data/sensitive.csv"}'
Response:
{
  "decision": "block",
  "reason": "Resource '/data/sensitive.csv' is blocked for this agent",
  "risk_score": 0.91,
  "risk_breakdown": {...}
}

PATCH /api/agents//profile

Update an agent’s permission profile from the API.
curl -X PATCH https://vaultak.com/api/agents/my-agent/profile
  -H "x-api-key: vtk_your_api_key_here"
  -H "Content-Type: application/json"
  -d '{
    "allowed_action_types": ["file_read", "api_call"],
    "allowed_resources": ["/tmp/*"],
    "blocked_resources": ["prod.*", "*.env"],
    "max_actions_per_minute": 20,
    "max_risk_score": 0.7
  }'

POST /api/actions

Log a completed agent action.
curl -X POST https://vaultak.com/api/actions
  -H "x-api-key: vtk_your_api_key_here"
  -H "Content-Type: application/json"
  -d '{"agent_id": "my-agent", "action_type": "file_write", "resource": "/tmp/output.txt"}'

GET /api/agents

List all registered agents with their permission profiles.
curl https://vaultak.com/api/agents
  -H "x-api-key: vtk_your_api_key_here"

GET /api/alerts

Retrieve active alerts.
curl https://vaultak.com/api/alerts
  -H "x-api-key: vtk_your_api_key_here"

Security Policies

Policies let you define rules that automatically block, pause, or allow actions.
curl -X POST https://vaultak.com/api/policies
  -H "x-api-key: vtk_your_api_key_here"
  -H "Content-Type: application/json"
  -d '{
    "name": "no-prod-deletes",
    "action_type": "file_delete",
    "resource_pattern": "prod.*",
    "effect": "block",
    "max_risk_score": 0.5,
    "priority": 10
  }'
FieldTypeDescription
namestrHuman-readable policy name
action_typestrAction type to match
resource_patternstrGlob pattern for resource matching
effectstrblock, pause, or allow
max_risk_scorefloatTrigger if risk score exceeds this value
priorityintHigher priority policies evaluated first