Skip to main content

Starvex - Production-ready AI agents with guardrails, observability, and security

Project description

Starvex

Production-ready AI agents with guardrails, observability, and security.

Installation

pip install starvex

Quick Start

  1. Get your API key at starvex.in/dashboard

  2. Login with your API key:

starvex login
  1. Use in your code:
from starvex import Starvex

vex = Starvex()

async def my_agent(prompt: str) -> str:
    # Your AI agent logic here
    return "Agent response"

# Secure your agent with guardrails
result = await vex.secure(
    prompt="User input",
    agent_function=my_agent
)

if result.status == "success":
    print(result.response)
elif result.status == "blocked":
    print(f"Blocked: {result.verdict.value}")

Features

Guardrails

Automatically detect and block:

  • Jailbreak attempts - Prompt injection attacks
  • PII leakage - Email, phone, SSN, credit cards
  • Toxic content - Harmful or inappropriate text
  • Competitor mentions - Block competitor references (configurable)

Observability

Full visibility into your AI agent behavior:

  • Real-time event tracing
  • Latency monitoring
  • Success/failure analytics
  • Dashboard at starvex.in/dashboard

Evaluation

Quality checks on agent outputs:

  • Hallucination detection
  • Faithfulness scoring
  • Relevancy analysis

CLI Commands

# Login with your API key
starvex login

# Check connection status
starvex status

# Check a prompt for safety
starvex check "Your prompt here"

# Test a prompt/response pair
starvex test --prompt "Question" --response "Answer"

# Show current configuration
starvex config --show

# Show version
starvex version

# Logout
starvex logout

API Reference

Starvex

from starvex import Starvex

vex = Starvex(
    api_key="sv_live_xxx",  # Or set STARVEX_API_KEY env var
    redact_pii=False,       # Mask PII before logging
    enable_tracing=True,    # Enable observability
)

Methods

secure(prompt, agent_function, context=None)

The main method - secures an AI agent interaction:

  1. Checks input safety (jailbreak, PII, toxicity)
  2. Calls your agent function
  3. Checks output quality (hallucination, toxicity)
  4. Logs everything to the dashboard
result = await vex.secure(
    prompt="User input",
    agent_function=my_agent,
    context=["Optional context for hallucination checking"],
    user_id="optional-user-id",
    session_id="optional-session-id",
)

protect(prompt)

Check input only (no agent execution):

result = await vex.protect("User input")
if result.status == "blocked":
    print("Input blocked!")

test(prompt, response, context=None)

Test mode - evaluate a prompt/response pair without tracing:

result = vex.test(
    prompt="What is 2+2?",
    response="2+2 equals 4",
    context=["Math fact: 2+2=4"]
)

Response Object

class GuardResponse:
    status: str          # "success", "blocked", "flagged"
    response: str        # The agent response (or block message)
    verdict: str         # PASSED, BLOCKED_JAILBREAK, BLOCKED_PII, etc.
    checks: list         # Detailed check results
    trace_id: str        # Unique trace ID for debugging
    latency_ms: float    # Total processing time
    warning: str | None  # Warning message if flagged

Environment Variables

Variable Description
STARVEX_API_KEY Your Starvex API key
STARVEX_API_HOST Custom API host (optional)
STARVEX_REDACT_PII Set to "true" to mask PII
STARVEX_LOG_LEVEL Logging level (DEBUG, INFO, WARNING, ERROR)

Dashboard

View your metrics and manage API keys at starvex.in/dashboard

  • Real-time request monitoring
  • Block rate analytics
  • Latency tracking
  • API key management
  • Guardrail configuration

Links

License

MIT

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

starvex-1.0.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

starvex-1.0.1-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file starvex-1.0.1.tar.gz.

File metadata

  • Download URL: starvex-1.0.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for starvex-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c8e8a48872374bd75e9378aa1195adccebeb637cce6e2334156d75ef9e04a527
MD5 f7c67ddefbe98f82e2c135dc53aa9780
BLAKE2b-256 8537e61486857117c2e29095fd691098fc7354380cc50796060c5e32b80189d6

See more details on using hashes here.

File details

Details for the file starvex-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: starvex-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for starvex-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a6ba213c9ec328fdc7b2e8c51fd99da8c0b3354a6bd3c1b90473dc9da9af5bb
MD5 7b3a5c240a719df3a304fb62913c05b9
BLAKE2b-256 dcb7d7f4733f7fe531168c2b9a324a8969c47026e7c94f775f9b7b28921e2c1a

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