Skip to content

Conversation

@shashank-factory
Copy link
Contributor

@shashank-factory shashank-factory commented Jan 13, 2026

Summary

Add support for security-focused code review commands.
Closes https://linear.app/factoryai/issue/FAC-14344/add-security-command-parser-and-trigger-detection
Closes https://linear.app/factoryai/issue/FAC-14355/create-security-review-prompt-template
Closes https://linear.app/factoryai/issue/FAC-14356/implement-preparesecuritymode-command-handler

New Commands

  • @droid security - Security review on PR changes using STRIDE methodology
  • @droid security --full - Full repository security scan with threat model generation

Changes

  • Security command parser (security, review-security, security-full)
  • Security review prompt with STRIDE methodology and severity definitions
  • Security scan prompt with threat model generation and PR creation
  • Security configuration inputs in action.yml
  • Security-specific tracking comment message

New Files

  • src/tag/commands/security-review.ts
  • src/tag/commands/security-scan.ts
  • src/create-prompt/templates/security-review-prompt.ts
  • src/create-prompt/templates/security-report-prompt.ts

This PR is part of a split from the security review feature branch.

PR Stack

  1. Formatting cleanup (chore: code formatting and style cleanup #16)
  2. This PR - Security commands foundation
  3. Review prompt JSON output pattern (next)
  4. Parallel workflow architecture (final)

Copy link
Contributor

@factory-droid factory-droid bot left a comment

Choose a reason for hiding this comment

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

Overall the security-command additions look directionally correct, but there are a couple of input/flow edge cases that can lead to non-deterministic behavior (NaN scan days) or prompts missing the tracking comment id in some paths. Addressing the inline notes should make the new security flows more robust.

Copy link
Contributor

@factory-droid factory-droid bot left a comment

Choose a reason for hiding this comment

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

Overall: the feature wiring looks coherent, but the security-review prompt currently instructs potentially unsafe/incorrect behavior (committing files to the contributor’s PR and suppressing inline comments), which can break expected review semantics. Fixing those prompt directives should make the new security flows safer and more reliable.

Base automatically changed from ssharma/pr1-formatting to dev January 15, 2026 18:21
@factory-droid
Copy link
Contributor

factory-droid bot commented Jan 15, 2026

Droid finished @shashank-factory's task —— View job


shashank-factory and others added 2 commits January 15, 2026 10:22
Add support for security-focused code review commands:

- @droid security - Security review on PR changes
- @droid security --full - Full repository security scan

New features:
- Security command parser (security, review-security, security-full)
- Security review prompt with STRIDE methodology
- Security scan prompt with threat model generation
- Security configuration inputs in action.yml
- Security-specific tracking comment message

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
- Fix SECURITY_SCAN_DAYS to avoid NaN (clamp to positive integer, default 7)
- Remove instructions to commit threat model to PR branch during review
- Remove instructions to commit patches to PR branch
- Align security review with JSON output pattern (no direct inline comments)

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@varin-nair-factory varin-nair-factory force-pushed the ssharma/pr2-security-commands branch from dff43cf to 01e9df8 Compare January 15, 2026 18:22
Copy link
Contributor

@factory-droid factory-droid bot left a comment

Choose a reason for hiding this comment

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

Overall: the PR is mostly correct and prior P1 issues look addressed, but the security-review prompt still instructs writing a JSON file instead of posting inline comments, and there’s no mechanism added here to publish those findings—so security review runs can end up with no inline feedback.

Copy link
Collaborator

@varin-nair-factory varin-nair-factory left a comment

Choose a reason for hiding this comment

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

approving to unblock, but pls see comments

@shashank-factory shashank-factory merged commit d721b68 into dev Jan 20, 2026
11 checks passed
@shashank-factory shashank-factory deleted the ssharma/pr2-security-commands branch January 20, 2026 18:32
@factory-droid
Copy link
Contributor

factory-droid bot commented Jan 20, 2026

Droid encountered an error —— View job


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