An open protocol that lets APIs improve from agent feedback.
AI agents are becoming major consumers of APIs. When an agent hits a missing capability, unclear docs, a surprising response or a bug, that information is lost. Your logs see the call. They don't see what the agent was trying to do.
The Agent Feedback Protocol gives every agent-facing service one standard interface, , where agents report what they were trying to do and what got in the way.
TypeScript SDK for the Agent Feedback Protocol: validate, send and receive structured feedback from AI agents.
2026-11-05
Bintang
—
Tool
—
Uptime
—
POST /feedback
Observability answers what failed? Agent feedback answers what was the user trying to do that our product couldn't do?
import { registerFeedbackTool } from "@backloop/mcp";
import { AGENT_FEEDBACK_INSTRUCTIONS, forwardTo } from "@backloop/sdk";
const server = new McpServer({ name: "acme", version: "1.0.0" }, { instructions: AGENT_FEEDBACK_INSTRUCTIONS });
registerFeedbackTool(server, { service: "acme-mcp", onRecord: forwardTo({ url, ingestKey }) });
Tell agents to report
An endpoint is not enough: agents report when they are told to. In a benchmark of Claude and GPT agents on an API with deliberate gaps, agents that only saw the Link header or a docs entry for /feedback almost never reported. With the standard instructions, in their prompt or in the API docs, the strongest models reported every problem they hit, including gaps they had worked around without an error.
dir: the API's folder, relative to the repository root. Omit it when the API is at the root. setup and test run inside it.
setup: installs what a fresh clone needs before test. Omit it when there is nothing to install. On Backloop it runs as an unprivileged user: nothing that needs root (apt-get, corepack enable).
test: runs the API's tests and exits 0 when they pass. null means nothing can run there; add a note saying why.
docs: the API reference (OpenAPI or Markdown), relative to the repository root. Omit it when there is none.
One line per command, strict JSON. Commit it to your default branch. Without it, Backloop reads the lockfile, and when that says nothing the coding agent works your tests out on its first run and adds the file to its pull request.
Try the whole path locally
Requires Node ≥ 22.13 and pnpm. Python ≥ 3.9 for the Python SDK tests.
pnpm demo:collector # reference collector → http://localhost:4700
pnpm demo:api # Acme Companies API → http://localhost:4610
pnpm demo:agents # 67 reports from 17 accounts, through the API's POST /feedback
Each simulated agent discovers the endpoint through /.well-known/agent-feedback, submits its report, and the API forwards the record to the collector. See what arrived:
curl -s localhost:4700/v1/summary # counts by type and endpoint, accounts, duplicates
cat data/feedback.jsonl # every record
pnpm demo:claude-agent runs a real Claude agent on a task against the Acme API. It hits the missing hiring-role filter and reports it. Needs ANTHROPIC_API_KEY.
pnpm bench measures how often agents report at all: real Claude agents on tasks with deliberate gaps, with and without each way of learning about POST /feedback. See the benchmark.
Security
Feedback text is written by third-party agents. Treat it as untrusted input end to end.
The SDKs redact bearer tokens, API keys, JWTs, private keys, card numbers and emails: the clients before sending, and the endpoint handlers before onRecord (redact, on by default), whatever client sent the report. Names in an agent's own words are not removed.
Services should pseudonymize accounts (hashAccount) before records leave them.
Don't relay agent-written text to other agents unless a human reviewed it.
Backloop
Backloop is the hosted platform built on this protocol. It clusters reports by what agents were trying to do, ranks them by impact, drafts the issue, and hands the fix to a coding agent. A human approves every PR, and what is pushed is the diff they reviewed; the coding agent runs code from your repository on the workspace's own machine, today under the platform's own user. The platform is not part of this repository; everything here works without it.
Development
pnpm build # all packages
pnpm test # TypeScript (vitest) + Python (unittest)
pnpm sync-schema # after editing spec/*.schema.json or AGENT_INSTRUCTIONS.md
The JSON Schemas in spec/ are the source of truth. scripts/sync-schema.mjs copies them into both SDKs, and both SDKs run the shared conformance suite; the TypeScript suite also cross-checks against Ajv.
Belum ada daftar tool. Server remote mendapatkannya setelah pemeriksaan kesehatan pertama.
FAQ
Pertanyaan
Bagaimana cara menginstal @backloop/sdk?
Salin konfigurasi stdio untuk Cursor, Claude Desktop, Claude Code, atau VS Code di halaman ini. Konfigurasi ini memakai instalasi dari penerbit, bukan proxy PlugMCP.
Apakah @backloop/sdk memerlukan kunci API?
Tidak ada variabel lingkungan wajib yang tercantum di catatan ini.
Transport apa yang digunakan @backloop/sdk?
@backloop/sdk berjalan secara lokal melalui stdio.
Kapan @backloop/sdk terakhir diperiksa?
Terakhir diperiksa 2026-11-05. TypeScript SDK for the Agent Feedback Protocol: validate, send and receive structured feedback from AI agents.