Repository navigation
fix(telegram): enforce direct-message tool policies - #120992
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
🦞👀 Pull request received. I will update this pull request when review starts. |
6776d1b to
e3b3bfb
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 9:39 AM ET / 13:39 UTC. ClawSweeper reviewWhat this changesThe PR carries Telegram direct-message tool policy through the agent runtime and makes Codex and Copilot either enforce that restricted tool surface or visibly refuse it. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this protected maintainer PR open. The Telegram/core and Copilot paths look coherent and the prior MCP-attestation finding is addressed, but the required Codex dependency-source check cannot be completed because sibling Priority: P1 Review scores
Verification
How this fits togetherTelegram resolves a trusted per-DM policy at ingress and attaches it to the queued agent run. Core applies that policy when selecting a harness and building its tool catalog, so a provider-native tool surface cannot bypass a configured denial. flowchart LR
A[Telegram direct message] --> B[Trusted direct policy]
B --> C[Queued agent run]
C --> D[Shared tool-policy pipeline]
D --> E[Harness selection]
E --> F[Codex or Copilot tools]
F --> G[Reply or visible refusal]
Before merge
Findings
Agent review detailsSecurityNeeds attention: No supply-chain or workflow change was found, but the security-sensitive Codex exact-enforcement claim depends on an unavailable upstream source contract. PR surfaceSource +314, Tests +1064, Docs +32, Generated 0. Total +1410 across 62 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Mantis proof suggestionA Telegram Desktop recording would directly demonstrate that a denied tool is unavailable while the restricted conversation still receives its expected visible outcome. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Verify Codex 0.147.0 source semantics, then retain this single ingress-to-canonical-policy design and merge only if exact-head checks remain green. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main accepts the direct configuration but does not carry it from Telegram ingress into the requester-policy pipeline; the PR adds focused regression coverage for that handoff. Is this the best way to solve the issue? Unclear: the selected owner boundary is the best apparent fix, but the Codex native-MCP status contract must be checked from its exact upstream source before the certification can be accepted. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0dbce297fd40. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
e3b3bfb to
0ccf64f
Compare
0ccf64f to
34f0a58
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
34f0a58 to
82c2cd0
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
76db88e to
13b3b90
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer decision: I accept the additive |
ee0c90e to
74d141a
Compare
74d141a to
457ee66
Compare
457ee66 to
29f144d
Compare
Closes #44886
Problem
Telegram DM
direct.<peer>.toolsandtoolsBySenderwere accepted, but native agent harnesses did not consume the selected requester policy. A denied tool could still be advertised and invoked.Fix
Telegram resolves the direct policy from trusted ingress and carries it through queues, retries, compaction, and descendants into the canonical tool-policy pipeline. Core prepares one explicit-policy restriction fact for harnesses. Codex replaces its native surface with policy-filtered OpenClaw equivalents; Copilot filters its full catalog, including native
ask_user. Harnesses that cannot certify exact enforcement now return a visible, actionable refusal.No explicit policy keeps existing access and native behavior unchanged. Default profiles stay unchanged. Telegram groups stay unchanged. Exact peers replace wildcard entries; global, agent, sender, and direct layers still apply together.
Evidence
execdenial still advertisedexec; the mock model attempted it, Telegram showed Exec progress, and the final reply arrived.AI-assisted maintainer change; implementation and evidence reviewed.