Skip to content

Blog

Notes from the @pleach/* maintainers.

Release rationale and explainers: audit records, cost attribution, and adopting the runtime in an agent you already run. Day-to-day fixes live in the per-package CHANGELOG.md, not here.

Nov 22, 2026Compliance9 min readAgent-drafted

How do you trace a model call back to the people who approved its configuration?

An examiner holding one model call wants to know which configuration produced it and who signed that configuration off. Pleach now records the approval as a chained row on the tenant's audit chain, so the walk from call to commit to approvers runs on records, not on memory.

Read
Nov 15, 2026Architecture15 min readAgent-drafted

Why a session locks one model family: tokenizer, prompt cache, tool dialect and refusals

A session that switches provider family mid-conversation changes how its prompt is counted, throws away its prompt cache, sends tool history in a schema the new model doesn't use, and meets refusals and errors its retry loop wasn't written for. Here's what each locked property protects, and what the lock leaves open.

Read
Nov 9, 2026Architecture9 min readAgent-drafted

How to bill a customer for agent usage you can defend: provider cost APIs vs gateway tags vs your own cost rows

Provider cost APIs group dollars by workspace, key and model — not by your end customer. Gateways group by a tag your code sets. Meters accept usage for 35 days but may never bill it. What it takes to produce an invoice line you can still explain when the customer asks.

Read
Nov 8, 2026Compliance10 min readAgent-drafted

How to erase a user from a hash-chained agent log: five approaches compared

A hash chain breaks if you delete a row, so erasure in an agent's audit log means re-rooting the chain or destroying a key. Each approach leaves copies behind, most often in backups. Delete-and-re-root, cloud KMS keys, data keys in your database, off-log storage and Kafka tombstones, compared.

Read
Nov 2, 2026Architecture8 min readAgent-drafted

Idempotency key vs unique constraint vs Redis lock: stopping a duplicate AI chat turn

How to keep a double click, a reconnect or a retry from starting a second AI agent turn. HTTP idempotency keys, a database unique constraint, a Redis SET NX lock and client debouncing compared on in-flight protection, retention, multi-instance behavior and what the duplicate gets back.

Read
Oct 28, 2026Architecture6 min readAgent-drafted

How to stream an LLM answer a guardrail may still block: five approaches compared

Streaming and output guardrails pull in opposite directions. Check each chunk before sending it and you pay latency. Send first and check later and unchecked text can reach the screen. Azure OpenAI, NeMo Guardrails, Guardrails AI, post-hoc correction and buffer-until-done, compared.

Read
Oct 27, 2026Architecture8 min readAgent-drafted

How to add human approval to AI agent tool calls: LangGraph, OpenAI Agents SDK, AI SDK and MCP compared

Approve a tool call before it runs, not after. How LangGraph, the OpenAI Agents SDK, the AI SDK and the MCP spec handle pausing, editing arguments, resuming after a restart, and an approval nobody answers.

Read
Oct 24, 2026Architecture8 min readAgent-drafted

How to track LLM cost per user request with subagents: provider usage APIs vs traces vs a lineage ledger

Provider usage APIs report cost per key, project or workspace in time buckets. Traces sum tokens per request when kept unsampled. A per-call row with a root request id rolls a subagent tree up with one GROUP BY.

Read
Oct 17, 2026Compliance10 min readAgent-drafted

What audit trail does an AI agent need for regulated review? Part 11, Annex 11 and the EU AI Act compared

What 21 CFR Part 11, EU GMP Annex 11 and the EU AI Act ask of an audit trail, mapped to the fields an AI agent's log should capture for each model call.

Read
Oct 10, 2026Compliance8 min readAgent-drafted

Hash chain vs WORM storage vs OpenTelemetry traces: making an LLM audit log tamper-evident

A hash chain detects edits, an append-only or WORM store refuses them, and traces explain behaviour. Each answers a different question, so most audit setups combine two.

Read
Oct 3, 2026Adoption7 min readAgent-drafted

How to add audit logging to an existing AI agent: OpenTelemetry vs proxy logs vs provider usage APIs vs your own table

Four layers can log the LLM calls of an agent you already run. Spans and proxy logs need little code. Provider usage APIs need none but report aggregates. A per-call table in your database carries your own tenant, tool, and turn keys.

Read

Want to follow along?

Subscribe to the blog feed or the changelog feed.