This is an automated email from the ASF dual-hosted git repository. hsluoyz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/casbin-gateway.git
commit 3a4d2c5e9bcc32ca8bf6abb7e02d272d43dea7c7 Author: Yang Luo <[email protected]> AuthorDate: Wed Aug 26 00:36:39 2026 +0800 docs(readme): say that prompts are recorded in full by default The README said nothing about a relayed request was stored until it was asked for, and listed llmRecordMode as defaulting to "off". Both the shipped conf/app.conf and the fallback in GetLlmRecordMode have been "full" — the whole request body, prompt included — so a reader who installed on the strength of that sentence got the opposite of it. Document what the code does, and point at the setting from the table. The same claim was in the LLM Records empty state, which now describes the state it is shown in rather than implying a default. --- README.md | 10 +++++----- README_zh.md | 10 +++++----- web/src/locales/en/data.json | 2 +- web/src/locales/zh/data.json | 2 +- web/src/pages/LlmRecordsPage.tsx | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index f410a91..de33a72 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ Everything is optional. Settings are changed on the **Settings** page of the web | `driverName` / `dataSourceName` | `sqlite` / `./data/casbin-gateway.db` | Where data is stored | | `gatewayEnabled` | `false` | Turns the reverse-proxy WAF on | | `gatewayHttpPort` / `gatewayHttpsPort` | `80` / `443` | Ports the proxy listens on | -| `llmRecordMode` | `off` | How much of each relayed LLM request is kept | +| `llmRecordMode` | `full` | How much of each relayed LLM request is kept — including the prompt, see [Recording prompts](#recording-prompts) | | `apiKeyEncryptionKey` | empty | Encrypts provider API keys at rest (AES-256-GCM) | | `casdoorEndpoint` | empty | Switches sign-in over to [Casdoor](https://casdoor.org) SSO | @@ -205,12 +205,12 @@ A previous Gateway still holding one of these ports is stopped first, so a resta ### Recording prompts -Nothing about a relayed request is stored until you ask for it, because a prompt can carry anything that was pasted into it. **Record metadata** and **Record metadata and bodies**, the buttons on the LLM Records page, turn it on for the next request; the Settings page holds the same choice and the limits around it, seeded from: +**Every relayed request is recorded in full from the first one, prompt included.** That is what the LLM Records page is made of, and none of it leaves this machine — but a prompt carries whatever was pasted into it, so if that is not what you want, this is the setting to change before you route an agent through Gateway. The picker at the top of the LLM Records page switches between **Recording off**, **Record metadata** and **Record metadata and bodies**, and takes effect from the next r [...] ```ini -; "off" keeps nothing, "metadata" records who called which model with which -; outcome, "full" also stores the request body — which is what LLM Records needs -; to show prompts, messages and tool schemas. +; The default is "full": it stores the request body, which is what LLM Records +; needs to show prompts, messages and tool schemas. "metadata" records only who +; called which model with which outcome, and "off" keeps nothing at all. llmRecordMode = "full" llmRecordRetentionDays = 30 llmRecordMaxRecords = 10000 diff --git a/README_zh.md b/README_zh.md index cc5528f..1bfe0be 100644 --- a/README_zh.md +++ b/README_zh.md @@ -176,7 +176,7 @@ podman compose up -d | `driverName` / `dataSourceName` | `sqlite` / `./data/casbin-gateway.db` | 数据存放位置 | | `gatewayEnabled` | `false` | 打开反向代理 WAF | | `gatewayHttpPort` / `gatewayHttpsPort` | `80` / `443` | 代理监听的端口 | -| `llmRecordMode` | `off` | 每次转发的 LLM 请求保留多少内容 | +| `llmRecordMode` | `full` | 每次转发的 LLM 请求保留多少内容 —— 包含提示词正文,见[记录提示词](#记录提示词) | | `apiKeyEncryptionKey` | 空 | 加密存储 Provider 的 API Key(AES-256-GCM) | | `casdoorEndpoint` | 空 | 把登录切换到 [Casdoor](https://casdoor.org) SSO | @@ -203,12 +203,12 @@ Gateway 启动时会打印它实际在做什么,所以可以直接看结果而 ### 记录提示词 -在你主动要求之前,转发请求的内容一概不存储,因为提示词里可能粘进任何东西。LLM Records 页面上的 **只记录元数据** 和 **记录元数据和正文** 两个按钮会从下一次请求起打开记录;设置页面里有同样的选项和相关的上限,它们的初始值来自: +**从第一个请求起,每次转发的请求都会被完整记录下来,包括提示词正文。** LLM Records 页面就是拿这些内容做出来的,它们也不会离开这台机器 —— 但提示词里粘进过什么它就带着什么,所以如果你不想要这样,在把 Agent 接进 Gateway 之前就该先改掉这个设置。LLM Records 页面顶部的选择框可以在 **不记录**、**只记录元数据** 和 **记录元数据和正文** 之间切换,从下一次请求起生效;设置页面里有同样的选项和相关的上限,它们的初始值来自: ```ini -; "off" 什么都不留,"metadata" 记录谁调用了哪个模型、结果如何, -; "full" 还会存下请求体 —— 这是 LLM Records 展示提示词、消息和 -; 工具 schema 所需要的。 +; 默认是 "full":它会存下请求体,这是 LLM Records 展示提示词、消息和 +; 工具 schema 所需要的。"metadata" 只记录谁调用了哪个模型、结果如何, +; "off" 则什么都不留。 llmRecordMode = "full" llmRecordRetentionDays = 30 llmRecordMaxRecords = 10000 diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index d60db29..900f9f4 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -465,7 +465,7 @@ "Record metadata": "Record metadata", "Record metadata and bodies": "Record metadata and bodies", "Recording is off": "Recording is off", - "Recording is off detail": "Nothing is recorded until you ask for it, because prompts can carry sensitive data. Metadata is who called which model with which outcome; bodies are the prompts themselves.", + "Recording is off detail": "Recording is turned off, so nothing about a relayed request is being kept. Metadata is who called which model with which outcome; bodies are the prompts themselves.", "Recording is on": "Recording is on", "Recording off": "Recording off", "Records were dropped": "{count} records were dropped because the write queue was full. Raise llmRecordQueueCapacity if this keeps happening.", diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index 0561c1d..a1459c2 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -465,7 +465,7 @@ "Record metadata": "只记录元数据", "Record metadata and bodies": "记录元数据和正文", "Recording is off": "记录功能已关闭", - "Recording is off detail": "除非你主动开启,否则不会记录任何内容,因为提示词可能包含敏感数据。元数据是谁调用了哪个模型、结果如何;正文则是提示词本身。", + "Recording is off detail": "记录已关闭,转发请求的内容一概不会被保留。元数据是谁调用了哪个模型、结果如何;正文就是提示词本身。", "Recording is on": "已开启记录", "Recording off": "关闭记录", "Records were dropped": "有 {count} 条记录因写入队列已满而被丢弃。如持续出现,请调大 llmRecordQueueCapacity。", diff --git a/web/src/pages/LlmRecordsPage.tsx b/web/src/pages/LlmRecordsPage.tsx index 70b9baf..7a039e3 100644 --- a/web/src/pages/LlmRecordsPage.tsx +++ b/web/src/pages/LlmRecordsPage.tsx @@ -230,9 +230,9 @@ export default function LlmRecordsPage({account}: {account: Account}) { }); }, [isAdmin]); - // Recording is off until someone asks for it. The Settings page holds the - // same field; changing it here is the shortcut, and it applies to the next - // request rather than the next restart. + // Recording is on by default, so this is mostly the way it gets turned down. + // The Settings page holds the same field; changing it here is the shortcut, + // and it applies to the next request rather than the next restart. const setRecordMode = (mode: string) => { setChangingMode(true); SettingBackend.getSetting() --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
