Repository navigation
fix(safety): O105 redact Moss config on direct read_file execute - #100
Merged
Merged
Conversation
Defense in depth: readFileTool.execute now runs presentToolOutput for isMossCredentialPath targets so apiKey never returns plaintext when bypassing the agent post-hook. Project .moss/devices.json is treated as a credential path alongside config.json. Directed tests cover execute redaction, agent-path regression, and non-credential fixtures.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
QiaolongLi1201
added a commit
that referenced
this pull request
Oct 11, 2026
fix(safety): O107 credential path realpath / symlink follow-up (#100 O105)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
O105(P2 安全)纵深防御:即使绕过 agent 展示层直接调
readFileTool.execute,.moss/config.json(及同类 Moss credential 路径)里的 apiKey 也不能以原文返回。实现策略(脱敏,非拒绝)
readFileTool.execute末尾:若isMossCredentialPath(filePath),对结果跑与 agent 相同的presentToolOutput(字段级[REDACTED];.apikey-key仍整文件Moss credential values withheld)。isMossCredentialPath对项目.moss/增补devices.json(与 known-secrets 扫描集对齐);config.json/ 用户 moss 目录 /.apikey-key原有覆盖不变。改动文件
src/tools/file-tools.ts— execute 路径脱敏src/safety/read-scope.ts— project.moss/devices.json纳入 credential 路径test/o105-config-credential-read.spec.mjs— 定向验收(撤修复变红)验收
.moss/config.json[REDACTED]config.json/.moss/tasks.jsonlisMossCredentialPath分支 → O105 定向 5 红 / 4 绿npm run checkBase
f26ff95a(#98 O93 合后 tip)