Skip to content

fix(ENG-12470): update inline docs to match implementation, scope Tier 2 to Tier 1 risky fields by default #30

Merged
hiskudin merged 3 commits intomainfrom
fix/tier2-default-example
Mar 27, 2026
Merged

fix(ENG-12470): update inline docs to match implementation, scope Tier 2 to Tier 1 risky fields by default #30
hiskudin merged 3 commits intomainfrom
fix/tier2-default-example

Conversation

@hiskudin
Copy link
Copy Markdown
Collaborator

@hiskudin hiskudin commented Mar 26, 2026

Summary

  • Removes redundant enableTier2: true from the JSDoc example (default is true)
  • Tier 2 now automatically scopes to the field names Tier 1 identified as risky, instead of scanning all strings in the tool result. Falls back to a full scan for unknown tools where no risky fields are detected. Explicit tier2Fields override still takes priority.

Changes

  • src/types.ts — add riskyFieldNames: string[] to SanitizationMetadata
  • src/core/tool-result-sanitizer.ts — collect field names that pass isRiskyField into metadata during Tier 1 traversal
  • src/core/prompt-defense.ts — use tier2Fields ?? riskyFieldNames when extracting strings for Tier 2

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 26, 2026 10:27
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the PromptDefense JSDoc example to reflect the actual default behavior of Tier 2 (enabled by default), avoiding an implication that Tier 2 must be explicitly opted in.

Changes:

  • Remove redundant enableTier2: true from the PromptDefense usage example in src/core/prompt-defense.ts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hiskudin hiskudin changed the title docs: fix example — enableTier2 is true by default docs(ENG-12470): fix example — enableTier2 is true by default Mar 26, 2026
hiskudin and others added 2 commits March 26, 2026 19:29
When no explicit tier2Fields override is set, Tier 2 now only scans
strings extracted from field names that Tier 1 identified as risky
(via isRiskyField). Falls back to full scan for unknown tools.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hiskudin hiskudin changed the title docs(ENG-12470): fix example — enableTier2 is true by default fix(ENG-12470): fix example — enableTier2 is true by default Mar 26, 2026
@hiskudin hiskudin changed the title fix(ENG-12470): fix example — enableTier2 is true by default fix(ENG-12470): scope Tier 2 to Tier 1 risky fields by default Mar 26, 2026
@hiskudin hiskudin changed the title fix(ENG-12470): scope Tier 2 to Tier 1 risky fields by default fix(ENG-12470): update inline docs to match implementation, scope Tier 2 to Tier 1 risky fields by default Mar 26, 2026
Copy link
Copy Markdown

@OMauriStkOne OMauriStkOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hiskudin hiskudin merged commit c103072 into main Mar 27, 2026
7 checks passed
@hiskudin hiskudin deleted the fix/tier2-default-example branch March 27, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants