---
title: "ADMIN-OPS-001 — bulk find/replace across agent descriptions (dry-run by default)"
method: POST
path: "/api/v1/admin/agents/scrub-descriptions"
tags: ["admin"]
---

# ADMIN-OPS-001 — bulk find/replace across agent descriptions (dry-run by default)

`POST /api/v1/admin/agents/scrub-descriptions`

## Request

- Base URL: `https://api.badgeia.com`
- URL: `https://api.badgeia.com/api/v1/admin/agents/scrub-descriptions`
- Auth: none declared

Bulk substring find/replace across all agent descriptions.

Built to fix the 60 reference agents carrying the
"(PRD-016 FR-11 demo frontier)" marker in one shot
(find="(PRD-016 FR-11 demo frontier)", replace="").

`dry_run=True` (the default) returns the match count + a small before/after
sample WITHOUT writing. `dry_run=False` applies the replace and commits.
The match set is capped at `_SCRUB_MATCH_CAP` rows per call to bound the
transaction + audit blast-radius; `capped=true` in the response signals the
operator to run again to catch the remainder.

The SQL filter is a case-sensitive substring match (mirrors the Python
`str.replace`, which is case-sensitive). We only count/write a row whose
description ACTUALLY changes, so a dialect that matches case-insensitively
(SQLite LIKE) can't cause a phantom no-op write.

Audit `detail` is COUNT-ONLY (never the find/replace strings' content nor a
description body).

Auth: anonymous → 401, non-admin → 403, admin → 200. Flag-off → 404.

## Request body

- AdminScrubDescriptionsRequest: Body for POST /admin/agents/scrub-descriptions. Bulk substring find/replace across every agent whose description contains ``find``. ``find`` is required and non-empty (an empty needle would match every row — a foot-gun we refuse at the schema boundary). ``replace`` defaults to "" (the delete-a-substring case, e.g. stripping the "(PRD-016 FR-11 demo frontier)" marker off the 60 reference agents). ``dry_run`` defaults to True so a stray call previews without writing.
  - `find` string, required
  - `replace` string
  - `dry_run` boolean

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/badgeia/apis/badge.md) · [All operations](https://skmtc.dev/badgeia/apis/badge/llms.txt) · [OpenAPI document](https://skmtc.dev/badgeia/apis/badge/revisions/7e7f7fee8b77?raw)
