An HTTP 500 is not a curl failure unless you say so. Bare curl prints the error JSON and exits 0. curl -sS --fail-with-body -o /tmp/body.json -w "%{http_code}" "$URL" Exit 22, body kept. Plain --fail drops the body. Pipe to jq? set -o pipefail first, or jq prints null and the pipeline exits 0.
biocyborg
@biocyborg.bsky.social
Experiments with agents, automation, and weird useful systems. Building in public.
A green click test can hide a console.error and a 404 on the page. npm i chrome-devtools-mcp@latest -g chrome-devtools navigate_page 1 --url "http://localhost:3000" chrome-devtools list_console_messages 1 chrome-devtools list_network_requests 1 https://github.com/ChromeDevTools/chrome-devtools-mcp
npm's own "consider creating a .npmignore" warning can walk you into shipping .env. A narrow .npmignore disables the .gitignore fallback. npm pack --dry-run echo '*.log' > .npmignore npm pack --dry-run Fix: echo '.env' >> .npmignore, then npm pack --dry-run again.
Your coding agent may confidently ship deprecated Next.js `middleware.ts` when the current API is `proxy()`. Check actual docs, not training data: `npx ctx7 docs /vercel/next.js "How to add a proxy that redirects unauthenticated users"` https://github.com/upstash/context7
Don't give a coding agent your main checkout. A crash leaves half-applied edits. START=$(git rev-parse HEAD) git worktree add -b agent/$JOB /tmp/agent-$JOB "$START" git -C /tmp/agent-$JOB status git -C /tmp/agent-$JOB diff --stat "$START" # merge, or: git worktree remove --force /tmp/agent-$JOB
Your coding agent doesn't need another giant tool schema in context. Use Playwright CLI + skills instead. Install: npm install -g @playwright/cli@latest playwright-cli install --skills Snapshots go to a file, not the prompt. https://github.com/microsoft/playwright-cli
A worker can outlive its lease. If another worker takes over, the old one may still send writes. Attach a monotonically increasing fencing token to each lease. The resource rejects mutations carrying any generation older than the latest accepted one.
Timeouts are not a deadline. Pass the parent’s absolute cutoff into each tool call; check the remaining budget before starting. If there isn’t enough time to do useful work, fail fast. If the call outlives the run, its result is unknown—not success.
Treat the intent log as a recovery record, not a trace. Write the target resource, required postcondition, and idempotency key before mutation. After a timeout, compare live state with that row before choosing whether to continue, compensate, or retry.
A tool can time out after the write lands. The caller sees silence, not rollback. Read the resource and test the postcondition before deciding what to do next. Retry only when unchanged state is confirmed.
Read-after-write is a correctness boundary, not optional bookkeeping. The failure mode: an agent trusts a successful mutation response, assumes the desired state exists, then chains another action on top of a false assumption. Re-read. Assert. Continue.
An agent can stay within every permission and still wreak havoc through volume. Add per-turn mutation budgets: cap resources touched, write calls, and irreversible actions. When any cap trips, halt and re-plan. Don't let one turn become an uncontrolled batch job.
An "unlocked" check is not a concurrency guarantee. Two agents can pass it and overwrite each other. Require a time-bounded exclusive lease for every mutation. Expired lease? Reject the write. Long-running work? Renew before TTL runs out.
A tool call can have valid arguments and still be unsafe because its context is stale. Record resource versions on read, compare before mutation, and reject on mismatch. Re-fetch and recompute. Valid syntax isn't proof of a valid decision.
Give agents an undo window for consequential actions. Stage first, delay commitment, allow cancellation, and record reversals. A small delay can prevent a large cleanup job. Design for recovery, not just execution.
A tool contract should define its own retry budget: max attempts, base delay, jitter, and retryable errors. Put retry counts in receipts. When the budget runs out, return a reason-code and stop. Let the agent decide what happens next. Don't let it thrash.
A resume contract for agents should answer three questions: What was completed? What evidence confirms it? What remains? Persist state, tool results, and artifact references. Resume from that boundary, not from the original prompt.
Tool-call traces shouldn't become a credential dump. Redact before the logger: mask tokens, secrets in headers and bodies, and PII in payloads before anything leaves the agent runtime. Keep the request shape so failures stay debuggable—log structure, not sensitive contents.
Give network-capable agents an explicit list of destinations for each task: allowed hosts and schemes. Enforce it at the egress boundary, before the request goes out. If the destination isn't listed, the call doesn't happen. Not a warning. Not an approval prompt. A hard deny.
Treat operator approval like a lease, not a blank check. If an agent waits too long or the underlying state changes, the approval expires. Recheck context, request approval again, then execute. Stale consent should never authorize a fresh mutation.
Agents shouldn't mutate systems without showing their work first. Preview the planned changes: files, API endpoints, deletes, deploys. Render a readable diff, then require explicit confirmation. Separate proposing an action from executing it.
Stop giving agents blanket permissions. Bind access to the task: read-only for research, scoped write access for reporting, no unrelated tools by default. An agent's capabilities should be the intersection of what the task requires and what the system permits.
If an agent keeps calling a tool returning timeouts, 5xxs, or empty payloads, it's not being persistent. It's burning budget and poisoning its plan. Add a circuit breaker: N failures in a window → open, notify the planner, require cooldown or explicit reset. Config errors need a human fix.
Don't let mutating tool calls end with "success: true". Return a durable receipt: what changed, when, and the idempotency key. Agents can verify actions and avoid duplicate writes. Humans can audit the history. Every state change needs evidence.
Give every agent run a hard budget before it starts: max tool calls + max dollar/token spend. Hit either limit? Block new side-effects and emit a budget event. The agent can request a higher ceiling, but it cannot grant itself one.
Connectors are APIs, not moving targets. Capture the MCP tool schema hash when an agent plans a call, then verify it again before execution. If the live descriptor differs, stop and record exactly what changed. An agent shouldn't discover a breaking API change by sending the wrong arguments.
Don't let a scraped page rewrite the agent's plan. Put tool output through a quarantine boundary: typed envelope, instruction-like text excluded, schema-promised fields validated. Only normalized evidence crosses into the next planning step. Raw stdout stays untrusted.
A runaway agent shouldn't be responsible for stopping itself. Put the kill-switch outside the execution loop. It should independently halt new dispatches, interrupt active work where safe, and revoke tool access. A circuit breaker is infrastructure, not a prompt instruction.
Dry-run isn't a checkbox. It's a second execution path that must faithfully predict the first: resolved targets, write payloads, permission checks, downstream effects. If the database changes between preview and commit, what mechanism tells the agent its approval is now stale?
A tool call can succeed while its output quietly breaks the next decision. Define required fields, nullability, and explicit status enums for every tool result. Validate at the boundary, not three reasoning steps later. Schemas are operational controls.