Skip to content

Conversation

@padenot
Copy link
Contributor

@padenot padenot commented Feb 6, 2026

This implements the policy as discussed on the 2026-02-05.

suhaibmujahid and others added 9 commits February 6, 2026 17:32
Converted file retrieval methods in PhabricatorPatch and related interfaces to async, replacing synchronous HTTP calls with httpx.AsyncClient.
Trusted users are now:
- Mozilla Corporation employees, OR
- Users with editbugs privilege who have been active within last year

This prevents dormant accounts with editbugs from being considered trusted.
Refactor metadata filtering into a SanitizedBug class that inherits from
Bug and overrides properties to return sanitized values when no trusted
user has commented.

When there's no trusted comment, the following are redacted:
- Bug title/summary
- Reporter name and email
- Assignee name and email

The trust check uses cached_property to avoid redundant API calls.
Bug.get() now returns SanitizedBug by default for security.
Refactor metadata filtering into a SanitizedPhabricatorPatch class that
inherits from PhabricatorPatch and overrides properties to return
sanitized values when no trusted user has commented.

When there's no trusted comment, the following are redacted:
- Revision title
- Author name and email
- Summary and test plan
- Diff author (if different from revision author)
- Stack graph titles

The trust check uses cached_property to avoid redundant API calls.
PhabricatorReviewData.get_patch_by_id() now returns SanitizedPhabricatorPatch.
This is now the full list from BMO
Automatically trust comments created before 2022 as prompt injection
was not a concern at that time. This applies to both comment content
validation and metadata redaction policies.
Ensure collapsed/admin tagged comments are excluded from all trust
validation logic, not just the timeline output:
- Skip when finding last trusted comment
- Skip when building trusted user cache
- Skip when checking for any trusted comment
Add comprehensive test coverage for:
- Admin-tagged comments being completely disregarded
- Pre-2022 comments being automatically trusted
- All collapsed tags (spam, abuse, nsfw, etc.) filtering

These tests validate the security policy changes implemented in
previous commits.
Copy link
Member

@suhaibmujahid suhaibmujahid left a comment

Choose a reason for hiding this comment

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

Thank you! It looks good to me, with a few comments.

We agreed not to use the last_seen_date activity data since it's not
useful for determining trust.
All Mozilla Corporation members are inherently in the editbugs group,
so checking both is redundant.
Changed Bug.get from @staticmethod to @classmethod to use cls instead
of hardcoding the return type. Modified MCP server to use SanitizedBug
directly so sanitization only happens at the API boundary.
The title is already displayed in the page header and is automatically
sanitized via the patch_title property.
Modified MCP server to use SanitizedPhabricatorPatch instead of
PhabricatorPatch so sanitization only happens at the API boundary.
This method is not used by the MCP server, so sanitization should not
be applied here. Sanitization is handled at the MCP server boundary.
The _display suffix is a new pattern not in master. Removing it to keep
the changes minimal and avoid introducing new naming conventions.
- Remove mozilla-corporation group check (only editbugs matters)
- Remove activity date checks (not useful for trust determination)
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