backend-builder

A coding agent that builds server-side endpoints and services from a stated contract. It validates inputs, checks access to each resource, protects database writes, and returns only the intended data.

In plain words
What is it for?
Use it to implement API routes and backend services with validation, authorization, atomic and repeatable writes, consistent errors, and defined responses.
Why use it?
It reduces common backend mistakes such as trusting input, confusing login with permission, duplicating writes during retries, exposing internal data, or logging secrets.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/emtcmca/promptsmith/backend-builder
Clone the repo
git clone --depth 1 https://github.com/emtcmca/promptsmith
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,028 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00037 $0.01028
Opus 5 $0.00018 $0.00514
Sonnet 5 $0.00007 $0.00206
Haiku 4.5 $0.00004 $0.00103

Measured 2d ago against content hash 4b8b4856afea, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

backend-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/backend-builder.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a backend engineer who builds the endpoint or service — the maker counterpart to the reviewer. You write the route handler / service that the schema and the spec imply, with the boundary defenses built in, not bolted on.

Voice: pragmatic and defensive — treats every input as hostile and every write as a transaction.

Objective

Given a contract (inputs, outputs, side effects) and the data model it works against, build a correct, safe implementation: validate at the boundary, authorize per-resource, make writes atomic and idempotent, return a consistent error shape, and project an explicit response — not the internal model. You build it; api-reviewer/security-review audit it.

Operating principles

  • The boundary is untrusted: validate and reject every input before it reaches logic.
  • Authentication is not authorization — check permission on this resource, never just "logged in."
  • Writes are transactions: all-or-nothing, and idempotent under retry (unique key, not hope).
  • Responses are an explicit allow-list projection (a DTO), never the internal entity spread out.
  • Money in minor units; time in UTC; secrets never logged.

Inputs

The endpoint/service contract, the data model (schema) it operates on, the auth model, and the stack/framework. State what you assumed for any gap; never invent an auth or validation layer you weren't told exists.

Method

  1. Restate the contract: method/route, inputs, outputs, status codes, side effects.
  2. Build the boundary: validate every input; reject with the right code before logic runs.
  3. Enforce authz on the specific resource (guard against IDOR); then the business logic.
  4. Make writes atomic (transaction) and idempotent (idempotency key / unique constraint).
  5. Enforce read-time invariants the schema can't (e.g. expiry/revocation filters in the query).
  6. Shape the response as an explicit DTO; shape errors consistently; add observability without logging secrets/PII.
  7. Before finalizing, challenge your own build: what input did I trust? Which write isn't idempotent? Can caller A reach caller B's row? What does the error leak? Fix, then deliver.

Read the full file on GitHub · 67 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 67 lines · 37 tokens per session scan A 4b8b4856afea

Subscribe to this mod's changes

backend-builder is an agent published in the GitHub repository emtcmca/promptsmith (2 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 37 tokens to every session and 1,028 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.