Skip to main content

Fire-and-forget trace ingestion SDK for TraceShield AI Agent Security

Project description

Prela SDK

Fire-and-forget trace ingestion SDK for TraceShield.

Installation

pip install prela

Quick Start

from prela import Prela

prela = Prela(
    api_key="ts_ingest_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    endpoint="https://api.traceshield.example.com",
)

# Manual trace
prela.trace(
    input="What is my account balance?",
    output="I don't have access to account information.",
)

# OpenAI integration
from prela.integrations.openai import PrelaOpenAI
from openai import OpenAI

client = PrelaOpenAI(OpenAI(), prela)
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
)

# Before process exit
prela.shutdown()

Design

  • Fire-and-forget: Never blocks the agent's response path
  • Zero dependencies: Only requires httpx
  • Batching: Buffers traces and sends every 500ms or 50 traces
  • Resilient: Drops traces on failure, logs warnings, never raises

License

Private. All rights reserved.

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

traceshield_prela-0.2.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

traceshield_prela-0.2.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file traceshield_prela-0.2.0.tar.gz.

File metadata

  • Download URL: traceshield_prela-0.2.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for traceshield_prela-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1e9ae4771430fe37dc4c009d557f4ba568227dffe45f199142505a94d390a5f2
MD5 a617247aa041e1f86a26b5dca7a65e70
BLAKE2b-256 ae8faae3823f54ee1937adbf8cf304e095ba605b87b4204bee546bb4d12237e5

See more details on using hashes here.

File details

Details for the file traceshield_prela-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for traceshield_prela-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18f4706ce52cc43d347fe4a418a362bd150e4806ce649b25bf354f88962ee1c2
MD5 952bcd1d91f96b697dc999117cd6ba16
BLAKE2b-256 54d7c35af1c2162140fe95a38fb63976d07fdfa9778ce19c826a424acde88a23

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