Skip to main content

sigil-agent

Python SDK for the Sigil persona registry. Pull personas and inject them into LLM system prompts.

Installation

pip install sigil-agent

Quick Start

from sigil import SigilClient

# Initialize client
client = SigilClient(api_key="sk_...", base_url="https://api.sigil.l8ntlabs.com")

# Fetch a persona
persona = client.get("staccato")

# Inject into system prompt
system_prompt = persona.inject()

# Or combine with a base prompt
system_prompt = persona.inject(base="You are a helpful assistant.")

Usage

Fetching Personas

from sigil import SigilClient

client = SigilClient(api_key="sk_...")

# Get latest version
persona = client.get("staccato")

# Pin a specific version
persona = client.get("staccato", version="1.0.0")

Accessing Persona Fields

persona = client.get("staccato")

# Core fields
print(persona.name)      # "staccato"
print(persona.version)   # "1.0.0"
print(persona.soul)      # The full soul/system text

# Voice configuration
print(persona.voice.tone)      # ["direct", "clear"]
print(persona.voice.dos)       # ["Be brief", ...]
print(persona.voice.donts)     # ["Ramble", ...]

# Values (sorted by priority)
for value in persona.values:
    print(f"{value.name}: {value.description} (priority: {value.priority})")

# Behavioral map
for key, behavior in persona.behavioral_map.items():
    print(f"{key}: {behavior.posture}")

Injecting into Prompts

The inject() method composes a well-formatted system prompt:

# Basic injection
system_prompt = persona.inject()

# With a base prompt prepended
system_prompt = persona.inject(base="You are an AI assistant for Acme Corp.")

The inject method combines:

  1. Base prompt (if provided)
  2. Soul text
  3. Voice rules (tone, dos, donts, example phrases)
  4. Values (sorted by priority)
  5. Behavioral guidelines

Configuration

Environment Variables

export SIGIL_API_KEY="sk_..."
export SIGIL_BASE_URL="https://api.sigil.l8ntlabs.com"
# Client will use env vars if not provided
client = SigilClient()

Client Options

client = SigilClient(
    api_key="sk_...",           # Required (or SIGIL_API_KEY env var)
    base_url="http://...",       # Default: http://localhost:8100
    timeout=10,                  # Request timeout in seconds
)

Error Handling

from sigil import SigilClient, SigilError, SigilNotFoundError, SigilAuthError

client = SigilClient(api_key="sk_...")

try:
    persona = client.get("nonexistent")
except SigilNotFoundError:
    print("Persona not found")
except SigilAuthError:
    print("Invalid API key")
except SigilError as e:
    print(f"API error: {e.message} (status: {e.status_code})")

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Type checking
mypy sigil

# Linting
ruff check sigil tests

License

MIT

Metadata

Release files for sigil-agent 0.1.1

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

Source distribution (sdist)

Source distribution for sigil-agent 0.1.1
File Size Uploaded Provenance Actions
sigil_agent-0.1.1.tar.gz 10.6 kB Without provenance Details for sigil_agent-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sigil-agent 0.1.1
File Interpreter ABI Platform Actions
sigil_agent-0.1.1-py3-none-any.whl Python 3 none any Details for sigil_agent-0.1.1-py3-none-any.whl

Total release size: 18.3 kB

Release files / sigil_agent-0.1.1.tar.gz

Download URL sigil_agent-0.1.1.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5ed002610a8a0b90196dfa4014594e3ecb0e6ae27795625de6cbb070f4443a33
BLAKE2b-256 checksum
How to use checksums
6934de436d212a442b898e2b1ae1c96dcb90e1ff5da71a763f39b13cb955f47b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / sigil_agent-0.1.1-py3-none-any.whl

Download URL sigil_agent-0.1.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b567b4cc74bad7a36a18e5998f458d1b29c8310a4ca54e096deee28d21580be
BLAKE2b-256 checksum
How to use checksums
6c0e06aa8ed54a91c3fc8d983f94a6f2bebc6c41ebbda41b61722e36a173cfc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for sigil-agent 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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