Skip to content

Add a GitHub repository threat model for Ruff - #28395

Merged
zsol merged 2 commits into
mainfrom
zsol/ruff-repository-threat-model
Sep 11, 2026
Merged

zsol merged 2 commits into
mainfrom
zsol/ruff-repository-threat-model

Conversation

@zsol

@zsol zsol commented Sep 7, 2026

Copy link
Copy Markdown
Member

Ruff's AGENTS.md describes how to review code, but it has no repository threat model for CI and release security reviews.

Add the GitHub repository threat model and link it from AGENTS.md. It sets out the boundaries for attacker-controlled input, privileged automation, and severity. The Ruff-specific section names pull request benchmark jobs declaring id-token: write for CodSpeed and the Docker build declaring packages: write. It asks reviewers to check effective authority and artifact flow before reporting a boundary crossing.

The generic model is copied from uv's repository threat model.

@zsol
zsol marked this pull request as ready for review September 7, 2026 18:09
Comment thread agents/references/repository-threat-model.md Outdated
@zsol
zsol added this pull request to stack #28524 September 11, 2026 16:50
@zsol
zsol merged commit f460839 into main Sep 11, 2026
49 checks passed
@zsol
zsol deleted the zsol/ruff-repository-threat-model branch September 11, 2026 17:00
carljm added a commit that referenced this pull request Sep 11, 2026
…aliases

* origin/main: (30 commits)
  [ty] Respect instance dictionary storage for slotted classes (#27749)
  Add a GitHub repository threat model for Ruff (#28395)
  [ty] Preserve wrapped signatures in nominal descriptor checks (#28466)
  [ty] Avoid rebinding extracted method calls (#28469)
  Recognize quoted types in `typing.TypeForm` (#28507)
  Support conditional assignment to `__lazy_modules__` (#28491)
  Add support for `__lazy_modules__` (#28459)
  [`pyupgrade`] Stop recommending deprecated `ByteString` aliases (`UP035`) (#28498)
  [ty] Anchor default exclude patterns at the project root (#28463)
  [ty] Add playground command to toggle inlay hints (#28517)
  [ty] Ignore divergent markers when detecting descriptors (#28514)
  [ty] Reuse rendered union elements when displaying types (#28494)
  [ty] Fix assignability of bounded typevars to intersection types (#28479)
  [ty] Retain package listings between resolution steps (#28278)
  Add accessors for comparison expressions (#28485)
  [ty] Refactor module resolution to use a `ModuleDirectory` abstraction. (#28418)
  [ty] Reduce retained AST memory by shrinking expressions (#28335)
  Bump version to 0.16.7 (#28496)
  Install rustfmt before linting releases (#28495)
  ensure prepare release changes pass prek (#28488)
  ...

# Conflicts:
#	crates/ty_python_semantic/src/types/bool.rs
zsol added a commit that referenced this pull request Sep 15, 2026
## Summary

The repository threat model in #28395 covers CI and release automation.
Ruff and ty also need security guidance for their command-line tools,
libraries, language servers, and browser playgrounds.

Add three models that define trusted inputs, security invariants, and
severity for these components, including the public playground sharing
API. An index linked from `AGENTS.md` points reviewers to the applicable
models.

Depends on #28395.

## Test Plan

Reviewed the trust assumptions and execution paths against the CLI,
language-server, and playground code.
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