Skip to content

Commit 8ea31f3

Browse files
Merge pull request #80 from Factory-AI/docs/readme-security-install-code-review
docs(readme): add /install-code-review setup and expand security review instructions
2 parents f0d5d03 + 7bf5107 commit 8ea31f3

1 file changed

Lines changed: 91 additions & 29 deletions

File tree

README.md

Lines changed: 91 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,29 @@ Everything runs inside GitHub Actions using your Factory API key, so the bot nev
1919

2020
## Installation
2121

22+
### Quick Setup with `/install-code-review` (Recommended)
23+
24+
The fastest way to get up and running is the guided installer built into the Droid CLI. From any local clone of your repo, run:
25+
26+
```bash
27+
droid
28+
> /install-code-review
29+
```
30+
31+
The guided flow will:
32+
33+
- Detect whether your repository lives on GitHub or GitLab.
34+
- Help you install the Droid GitHub App (or configure GitLab access).
35+
- Generate the workflow files (`droid.yml` and `droid-review.yml`) with sensible defaults.
36+
- Prompt you for `review_depth`, security review options, and other inputs.
37+
- Open a PR/MR containing the new workflow files for you to review and merge.
38+
39+
For GitHub-only setups you can also run `/install-github-app`. See the [Automated Code Review guide](https://docs.factory.ai/guides/droid-exec/code-review) and the [GitHub App installation guide](https://docs.factory.ai/cli/features/install-github-app) for full details.
40+
41+
### Manual Setup
42+
43+
If you prefer to wire things up by hand:
44+
2245
1. **Install the Droid GitHub App**
2346
- Install from the Factory dashboard and grant it access to the repositories where you want Droid to operate.
2447
2. **Create a Factory API Key**
@@ -67,7 +90,7 @@ jobs:
6790
fetch-depth: 1
6891

6992
- name: Run Droid Exec
70-
uses: Factory-AI/droid-action@v5
93+
uses: Factory-AI/droid-action@main
7194
with:
7295
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
7396
```
@@ -104,13 +127,14 @@ jobs:
104127
fetch-depth: 1
105128
106129
- name: Run Droid Auto Review
107-
uses: Factory-AI/droid-action@v5
130+
uses: Factory-AI/droid-action@main
108131
with:
109132
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
110133
automatic_review: true
134+
automatic_security_review: true
111135
```
112136

113-
Set `automatic_review: true` to run code reviews automatically on non-draft PRs.
137+
Set `automatic_review: true` to run code reviews automatically on non-draft PRs. Set `automatic_security_review: true` to additionally run a STRIDE-based security review concurrently on every non-draft PR.
114138

115139
## Using the Commands
116140

@@ -128,16 +152,60 @@ Set `automatic_review: true` to run code reviews automatically on non-draft PRs.
128152

129153
### `@droid security`
130154

131-
- Mention `@droid security` in a PR comment.
132-
- Droid performs a security-focused review using STRIDE methodology (Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege).
133-
- Findings include severity levels, CWE references, and suggested fixes.
155+
- Mention `@droid security` in a PR comment to trigger an on-demand security review of the PR diff.
156+
- Droid runs a security-focused review using STRIDE methodology (Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege) along with OWASP Top 10 and OWASP LLM Top 10 checks.
157+
- Each finding includes a severity level, CWE reference (where applicable), an explanation, and a suggested fix posted as inline review comments.
158+
- Set `automatic_security_review: true` in your auto-review workflow to run the security pass on every non-draft PR alongside the standard code review (the two run concurrently).
134159

135160
### `@droid security --full`
136161

137-
- Performs a full repository security scan (not just PR changes).
138-
- Creates a new branch with a security report at `.factory/security/reports/security-report-{date}.md`.
139-
- Opens a PR with findings and auto-generated patches where possible.
140-
- Useful for scheduled security audits.
162+
- Performs a full repository security scan instead of just PR changes — useful for scheduled audits or onboarding a new repo.
163+
- Creates a new branch and opens a PR containing a security report at `.factory/security/reports/security-report-{date}.md` plus auto-generated patches where Droid is confident in the fix.
164+
- To run on a schedule, invoke the action from a cron-triggered workflow with `security_scan_schedule: true`. Use `security_scan_days` to control how many days of recent commits are included.
165+
166+
#### Enabling automatic security review
167+
168+
To run the security review on every non-draft PR (alongside the regular code review), add `automatic_security_review: true` to your `droid-review.yml`:
169+
170+
```yaml
171+
- name: Run Droid Auto Review
172+
uses: Factory-AI/droid-action@main
173+
with:
174+
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
175+
automatic_review: true
176+
automatic_security_review: true
177+
```
178+
179+
#### Scheduling full-repo scans
180+
181+
```yaml
182+
name: Droid Security Scan
183+
184+
on:
185+
schedule:
186+
- cron: "0 9 * * 1" # Every Monday at 09:00 UTC
187+
workflow_dispatch:
188+
189+
jobs:
190+
security-scan:
191+
runs-on: ubuntu-latest
192+
permissions:
193+
contents: write
194+
pull-requests: write
195+
issues: write
196+
id-token: write
197+
actions: read
198+
steps:
199+
- uses: actions/checkout@v5
200+
with:
201+
fetch-depth: 0
202+
203+
- uses: Factory-AI/droid-action@main
204+
with:
205+
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
206+
security_scan_schedule: true
207+
security_scan_days: 7
208+
```
141209

142210
## Configuration
143211

@@ -171,46 +239,40 @@ The `review_depth` input controls which model and reasoning effort are used for
171239

172240
```yaml
173241
# Deep review (default - no extra config needed)
174-
- uses: Factory-AI/droid-action@v5
242+
- uses: Factory-AI/droid-action@main
175243
with:
176244
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
177245
automatic_review: true
178246
179247
# Shallow review for faster feedback
180-
- uses: Factory-AI/droid-action@v5
248+
- uses: Factory-AI/droid-action@main
181249
with:
182250
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
183251
automatic_review: true
184252
review_depth: shallow
185253
186254
# Fully custom model (overrides depth preset entirely)
187-
- uses: Factory-AI/droid-action@v5
255+
- uses: Factory-AI/droid-action@main
188256
with:
189257
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
190258
automatic_review: true
191-
review_model: claude-sonnet-4-5-20250929
259+
review_model: claude-sonnet-4-6
192260
reasoning_effort: high
193261
```
194262

195263
> **Tip:** Setting `review_model` or `reasoning_effort` explicitly always takes priority over the depth preset. You can mix and match -- for example, use `review_depth: shallow` but override just `reasoning_effort: high` to get the shallow model with higher reasoning.
196264

197-
### Updating Review Models
198-
199-
The depth presets are defined in [`src/utils/review-depth.ts`](src/utils/review-depth.ts). To change which models are used for shallow or deep reviews, edit the `REVIEW_DEPTH_PRESETS` object:
265+
The default models (`gpt-5.2` for `deep`, `kimi-k2-0711` for `shallow`) are managed by Factory and may change over time. To pin a specific model regardless of the depth preset, set `review_model` to any model ID supported by `droid exec --model`. A few common choices:
200266

201-
```typescript
202-
const SHALLOW_DEFAULTS = {
203-
model: "kimi-k2-0711", // Change to any supported model
204-
reasoningEffort: undefined, // undefined = use model default
205-
};
206-
207-
const DEEP_DEFAULTS = {
208-
model: "gpt-5.2", // Change to any supported model
209-
reasoningEffort: "high", // "high" | "medium" | "low" | undefined
210-
};
211-
```
267+
- `claude-opus-4-7`
268+
- `claude-sonnet-4-6`
269+
- `claude-haiku-4-5`
270+
- `gpt-5.5`
271+
- `gpt-5.5-pro`
272+
- `gpt-5.3-codex`
273+
- `kimi-k2.6`
212274

213-
Individual users can also override these defaults per-workflow without modifying the source by setting `review_model` and/or `reasoning_effort` inputs directly in their workflow YAML.
275+
See the [CLI reference](https://docs.factory.ai/reference/cli-reference#available-models) for the canonical, up-to-date list.
214276

215277
### Security Configuration
216278

0 commit comments

Comments
 (0)