Works, with the reasoning included.
Write-ups from shipping backends, AI infrastructure, and automation — what got built, what broke, and the tradeoffs behind the decisions.
A spec for coding agents needs precedence rules and a graveyard
Structure a large-migration spec so AI agents (or contractors) can execute it safely: explicit conflict-precedence rules, a rejected-alternatives section, phase gates with acceptance criteria, and a stop-and-flag escape hatch.
Deletion across data systems is a workflow, not a query
Coordinate erasure through an idempotent, checkpointed workflow when one subject's data spans operational, analytical, and AI stores.
Enforce budgets at the level the human approved them
Aggregate usage counters up to the granularity the approver actually saw, so wildcard expansion can't silently multiply an approved ceiling by the number of rows it fanned out into.
How to measure the real cost of an agent evaluation
A practical accounting model for judge calls, agent calls, retries, and the unattributed work that per-case dashboards often hide.
Your approval form is untrusted input
Harden a consent endpoint by re-deriving everything from the server-side document, letting the approver's payload only narrow what was asked, and claiming the state transition conditionally.
Streaming is a metering bypass until you make it not one
Meter SSE responses by tapping the stream with a pass-through scanner that extracts provider-reported usage at flush time — and make your protocol translators preserve usage and termination guarantees.
Version the policy and evaluator separately
Record decision rules independently from measurement logic so AI behavior can be replayed, compared, and audited honestly.
Extensions as data: freeze the document at install, never fetch it again
Split an extension system into a handful of built-in adapters plus declarative documents that are reviewed once, frozen verbatim into the database, and never re-fetched — closing the TOCTOU gap that makes runtime plugins dangerous.
Token rotation assumes your clients can write
Choose credential mechanics based on whether your callers can persist new state at runtime — and offer a static-token tier plus an optional proof-of-possession tier instead of rotation your ecosystem can't implement.
Make your evaluation harness run the agent you ship
Use the production context path with synthetic data, relative dates, and structural fixtures so an eval measures real behavior without copying private state.
Cron is a janitor, not a guard
Enforce expiry inline on the request path and demote scheduled jobs to pure housekeeping, so a slow or missing cron can never extend anyone's access.
What should block a deploy for an LLM application?
Build a release gate around consequence, deterministic contracts, calibrated model judgments, missing evidence, and controlled baselines.
Verify the signature before you burn the nonce
Order the checks in a replay-protected auth scheme so that unauthenticated callers can't consume nonces, poison retries, or grow your replay table.
Optional intelligence needs hard failure boundaries
Keep semantic enrichment from taking down core processing by modeling dependencies, fallbacks, and degraded results explicitly.
Webhooks don't wait for cold starts
Put an always-on edge relay between at-most-once webhook producers and a sleepy backend: accept instantly, persist per-destination, redeliver with retries — without holding the provider's secret.
Rate limiting in Postgres is fine (and dropped a whole backing service)
Replace Redis-backed rate limits, quotas, and replay nonces with three small Postgres tables using upsert-increment and unique-insert patterns, without changing enforcement semantics.
How to find tests that assert nothing
Turn conditional validation into positive output contracts, reject invalid test declarations, and report cases that still lack expectations.
One JSON file keeps every SDK honest
Pin a cross-language wire protocol with a shared test-vector file — fixed keys, canonical strings, and expected signatures — that every implementation's test suite consumes verbatim.
Freshness should choose the compute path
Route requests across batch, incremental, and live evidence according to measured coverage rather than a fixed data source.
Every URL your admin pastes is an SSRF vector
Build a guarded fetch for user-supplied URLs that validates scheme and DNS on every redirect hop, rejects non-canonical IP literals, and caps time and size — and route all such fetches through it.
Groundedness is not one property
How to scope a hallucination grader across user-specific claims, general knowledge, and interpretation without making the judge permissive.
Keeping agents fast with fewer hops and smaller context
A measurement-driven approach to removing unnecessary model calls, persistent state, prompt payloads, and post-tool narration.
Live and final are different data products
Model in-progress and completed reporting periods separately so partial evidence cannot overwrite settled history.
Move the model out of the request path
Precompute versioned AI artifacts so user requests read predictable results instead of waiting on variable inference.
Observability for multi-step agent systems
Instrument traces, model usage, tool calls, and evaluation results with one correlation model while keeping sensitive prompt data out of telemetry.
The model should generate content, not identity
Keep names, identifiers, ownership, and authorization outside model output so generated content cannot cross entity boundaries.
Memory is not context: a safe storage boundary for agents
Separate live state from durable user-stated facts, then add provenance, expiry, deletion, and intent-based retrieval.
Low confidence can be useful without being visible
Preserve uncertain observations for continuity while using a separate, deterministic policy to decide what reaches a user.
Facts, affordances, and pertinence in agent design
A concrete boundary for deciding which agent behavior belongs in deterministic code and which decisions should remain with the model.
Use models for ambiguity and code for consequence
Place probabilistic reasoning behind a typed boundary, then let deterministic code decide what the system stores, ranks, and shows.
Structured data is still untrusted input
Sanitize metadata and JSON-LD before storage, then render a bounded fact document instead of placing arbitrary page markup into an LLM prompt.
Build a context ladder for your agent
Classify agent data by lifetime, freshness, sensitivity, and retrieval cost, then compile only the context required for each turn.
A timestamp is not a time context
Store events in UTC, define one business calendar, and let deterministic code resolve phrases such as today before an agent queries data.
Agents do not see reality. They see data products.
Build an evidence pipeline that turns raw events into typed, traceable facts before an agent can retrieve or reason over them.