DOCS/BUILD
SELF-HOSTED8 MIN READUPDATED 03 SEP 2026

BUILD / 02

Move an existing AI client behind SHREDDAR.

Use the non-streaming OpenAI-compatible adapter with task-bound privacy controls.
Most client code only needs a new base URL, a local gateway credential, and three SHREDDAR fields. The upstream receives protected messages; the trusted application receives the protected response plus receipt metadata.
PYTHON SDK

Change the boundary, not the application model

PYTHONpython
import os
from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:8787/v1",
    api_key=os.environ["SHREDDAR_API_KEY"],
)

response = client.chat.completions.create(
    model="configured-upstream",
    messages=[{"role": "user", "content": private_context}],
    stream=False,
    extra_body={
        "shreddar_task": "Review termination obligations",
        "shreddar_policy": "strict-v1",
        "shreddar_privacy_mode": "strict",
    },
)

receipt = response.model_extra["shreddar"]["receipt"]
REQUEST EXTENSIONS

Bind every request to purpose and policy

FIELDDEFAULTUSE
shreddar_taskemptyExact downstream purpose; make this narrow and concrete
shreddar_policybalanced-v1Versioned policy identifier
shreddar_privacy_modebalancedbalanced, strict, maximum, or custom
modelrequiredshreddar-demo or configured-upstream
streamfalseStreaming is rejected in the alpha
RESPONSE CONTRACT

Inspect the SHREDDAR envelope

  • choices contains the guarded model response.
  • shreddar.protected_messages shows exactly what was approved for inference.
  • shreddar.receipt records policy, route, counts, and integrity metadata.
  • shreddar.warnings surfaces uncertainty and boundary conditions.
  • Reconstruction occurs only through an authorized application path, never automatically inside an agent tool.
INTEGRATION TEST

Prove what the upstream saw

  1. 01

    CANARY

    Use a synthetic identifier and credential-like canary that must never appear upstream.

  2. 02

    CAPTURE

    Inspect protected_messages and an upstream test double rather than assuming proxy behavior.

  3. 03

    FAILURE

    Exercise timeout, 4xx, 5xx, blocked output, and local_only paths.

  4. 04

    RECEIPT

    Verify the request id and hash chain independently after the call.

SHREDDAR DOCSYOUR DOC. YOUR DATA. YOUR CONTROL.

Public alpha documentation. Capability labels describe implementation state, not certification or guaranteed suitability.