Skip to content

fix: export ToolSanitizationRule and add tier2Fields option#15

Closed
hiskudin wants to merge 1 commit into
mainfrom
feat/export-tool-sanitization-rule
Closed

fix: export ToolSanitizationRule and add tier2Fields option#15
hiskudin wants to merge 1 commit into
mainfrom
feat/export-tool-sanitization-rule

Conversation

@hiskudin

@hiskudin hiskudin commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Exports ToolSanitizationRule from the package's public API
  • Consumers passing custom toolRules via PromptDefenseOptions.config can now properly type them without reaching into internal modules

Test plan

  • All tests pass
  • Consumers can now import type { ToolSanitizationRule } from '@stackone/defender'

🤖 Generated with Claude Code


Summary by cubic

Exported ToolSanitizationRule from the public API so consumers can type custom toolRules in PromptDefenseOptions.config without importing internal modules. You can now import type { ToolSanitizationRule } from '@stackone/defender'.

Written for commit 9ad0318. Summary will update on new commits.

Allows consumers to properly type custom toolRules passed via
PromptDefenseOptions.config without importing from internal modules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 10, 2026 14:23
@hiskudin hiskudin changed the title feat: export ToolSanitizationRule type from public API feat(ENG-12109): export ToolSanitizationRule type from public API Mar 10, 2026

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

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR exports the ToolSanitizationRule type from the package's public API (src/index.ts), so that consumers who pass custom toolRules via PromptDefenseOptions.config can now type them using import type { ToolSanitizationRule } from '@stackone/defender' without reaching into internal modules.

Changes:

  • ToolSanitizationRule is added to the public re-export list in src/index.ts

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

You can also share your feedback on Copilot code review. Take the survey.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM — straightforward type-only re-export, no runtime changes.

Extended reasoning...

Overview

This PR adds a single type export (ToolSanitizationRule) to src/index.ts. The type is already defined in src/types.ts and used extensively throughout the internal codebase (sanitizer, field-detection, config). This change simply makes it available to external consumers of the package.

Security risks

None. This is a type-only export — it has zero runtime impact. No new code paths, no behavioral changes, no new dependencies.

Level of scrutiny

Minimal scrutiny warranted. This is a one-line change adding a type re-export to the public barrel file. The type already exists and is stable. The change follows the exact same pattern as the existing RiskLevel and Tier1Result exports on the same line.

Other factors

No outstanding reviewer comments. No CODEOWNERS concerns. The bug hunting system found no issues. The change is self-contained and mechanical.

@hiskudin hiskudin changed the title feat(ENG-12109): export ToolSanitizationRule type from public API fix: export ToolSanitizationRule and add tier2Fields option Mar 11, 2026
@hiskudin

Copy link
Copy Markdown
Collaborator Author

Superseded by PR from fix/tier2-fields-and-exports which includes this change plus tier2Fields support.

@hiskudin hiskudin closed this Mar 11, 2026
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.

2 participants