Self-Knowledging APIs: Governed Runtime Memory as an Architectural Layer for Agent-Driven Business Services
Business APIs encode fast-changing policy: fees, allowances, eligibility windows and compensation rules. In conventional backends every policy change is a code edit that waits for a release. LLM agents with long-term memory can absorb such changes from operational messages immediately, but they also absorb injected, unauthorised and stale “policy” from the same channels. We present Self-Knowledging APIs, an architecture in which a supervisor agent turns selected runtime messages into versioned knowledge stories through a governed write path (extraction, PII redaction, injection screening, writer authorisation, conflict checks, quarantine with human review, and provenance-based rollback). Deterministic tools keep executing operations, while the read path attaches a policy trace to every response. We evaluate a reference implementation on 90-day simulated operations built from public τ-bench airline and retail records and policies: 13,500 API calls and about 10,900 runtime messages per run, including 58 adversarial ones. Across 10 seeds, the governed design answers 97.1% of calls correctly, against 91.7% for a hard-coded backend with weekly releases, 73.8% for log-based RAG and 68.5% for ungoverned memory. It cuts attack-induced errors from 27.8% (ungoverned) to 1.3%, keeps no personal data in memory, and lowers p90 policy-change latency from 146 h to 12.7 h at a review cost of about one item per day. Ablations show that writer authorisation matters far more than lexical injection screening. We also report where the approach loses: a daily-release backend matches it, and reviewer error dominates under heavy attack. Code, data pipeline and results are released.
Authors
- Sangram Palavarapu
- Nithin Kumar Kandagatla
- Prathyush Kumar Seridoddi
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-23
- DOI
- https://doi.org/10.5281/zenodo.24455902
- Primary Topic
- Software System Performance and Reliability
- Type
- preprint