You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+91-29Lines changed: 91 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,29 @@ Everything runs inside GitHub Actions using your Factory API key, so the bot nev
19
19
20
20
## Installation
21
21
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
+
22
45
1.**Install the Droid GitHub App**
23
46
- Install from the Factory dashboard and grant it access to the repositories where you want Droid to operate.
24
47
2.**Create a Factory API Key**
@@ -67,7 +90,7 @@ jobs:
67
90
fetch-depth: 1
68
91
69
92
- name: Run Droid Exec
70
-
uses: Factory-AI/droid-action@v5
93
+
uses: Factory-AI/droid-action@main
71
94
with:
72
95
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
73
96
```
@@ -104,13 +127,14 @@ jobs:
104
127
fetch-depth: 1
105
128
106
129
- name: Run Droid Auto Review
107
-
uses: Factory-AI/droid-action@v5
130
+
uses: Factory-AI/droid-action@main
108
131
with:
109
132
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
110
133
automatic_review: true
134
+
automatic_security_review: true
111
135
```
112
136
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.
114
138
115
139
## Using the Commands
116
140
@@ -128,16 +152,60 @@ Set `automatic_review: true` to run code reviews automatically on non-draft PRs.
128
152
129
153
### `@droid security`
130
154
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).
134
159
135
160
### `@droid security --full`
136
161
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
+
```
141
209
142
210
## Configuration
143
211
@@ -171,46 +239,40 @@ The `review_depth` input controls which model and reasoning effort are used for
171
239
172
240
```yaml
173
241
# Deep review (default - no extra config needed)
174
-
- uses: Factory-AI/droid-action@v5
242
+
- uses: Factory-AI/droid-action@main
175
243
with:
176
244
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
177
245
automatic_review: true
178
246
179
247
# Shallow review for faster feedback
180
-
- uses: Factory-AI/droid-action@v5
248
+
- uses: Factory-AI/droid-action@main
181
249
with:
182
250
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
183
251
automatic_review: true
184
252
review_depth: shallow
185
253
186
254
# Fully custom model (overrides depth preset entirely)
187
-
- uses: Factory-AI/droid-action@v5
255
+
- uses: Factory-AI/droid-action@main
188
256
with:
189
257
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
190
258
automatic_review: true
191
-
review_model: claude-sonnet-4-5-20250929
259
+
review_model: claude-sonnet-4-6
192
260
reasoning_effort: high
193
261
```
194
262
195
263
> **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.
196
264
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:
200
266
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
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.
0 commit comments