Skip to content

Add Pro prompt redaction integration#538

Open
Axiaoiac wants to merge 2 commits into
devfrom
codex/pro-prompt-redaction-clean
Open

Add Pro prompt redaction integration#538
Axiaoiac wants to merge 2 commits into
devfrom
codex/pro-prompt-redaction-clean

Conversation

@Axiaoiac

Copy link
Copy Markdown
Contributor

Summary

This PR integrates FlocksPro prompt redaction into the Flocks agent runtime and Pro settings UI.

The actual sensitive detection engine and bundled wheels live in the corresponding flockspro branch. This PR makes Flocks apply the Pro hook in the real model/tool/title/summary flows, so sensitive values can be redacted before model input and restored before tool execution or user-visible output.

Changes

  • Apply llm.call.before hook output back to the real provider request.
  • Redact non-system messages before model calls while keeping system prompts unchanged.
  • Restore protected values before tool execution.
  • Move tool restoration before publishing tool running state, avoiding protected values in the process panel.
  • Apply redaction/restoration to title generation.
  • Apply redaction/restoration to summary and context compaction.
  • Add shared LLM hook helper utilities.
  • Add Pro settings UI entry for enabling/disabling prompt redaction.
  • Add frontend API wrapper for sensitive detection settings.
  • Add tests for runner hook writeback and stream processor tool restoration.

Behavior

When the feature is enabled in FlocksPro settings:

  • system messages are kept unchanged.
  • user, assistant, and tool messages are redacted before entering the model.
  • Tool-call arguments are restored before execution.
  • Final replies, titles, summaries, and compaction outputs are restored before being shown or saved.
  • The feature remains disabled by default.

Validation

  • tests/session/test_runner_llm_hooks.py
  • tests/session/test_stream_processor.py
  • webui npm run build

Result: passed locally.

Related

Requires the corresponding FlocksPro branch:

  • codex/privacy-detect-pro-clean

That branch provides the bundled sensitive detection runtime, prompt redaction settings, hook implementation, and documentation.

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.

1 participant