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
gh pr list --repo nvidia/garak --state open --search "<issue_number> in:body"
20
+
gh pr list --repo nvidia/garak --state open --search "<short area keywords>"
21
+
```
22
+
23
+
- If an open PR already addresses the same fix, do not open another.
24
+
- If your approach is materially different, explain the difference in the issue.
25
+
26
+
### No low-value busywork PRs
27
+
28
+
Do not open one-off PRs for tiny edits (single typo, isolated style change, one mutable default, etc.). Mechanical cleanups are acceptable only when bundled with substantive work.
29
+
30
+
### Cohesive PRs
31
+
32
+
Each PR should have a clear focus. Only update files related to the topic of that PR.
33
+
34
+
### Accountability
35
+
36
+
- Pure code-agent PRs are **not allowed**. A human submitter must understand and defend the change end-to-end.
37
+
- The submitting human must review every changed line and run relevant tests.
38
+
- PR descriptions for AI-assisted work **must** include:
39
+
- Why this is not duplicating an existing PR.
40
+
- Test commands run and results.
41
+
- Clear statement that AI assistance was used.
42
+
43
+
### Fail-closed behavior
44
+
45
+
If work is duplicate/trivial busywork, **do not proceed**. Return a short explanation of what is missing.
46
+
47
+
### Project Guides
48
+
49
+
Check the docs on "Contributing" and "Extending", in `docs/source`, and follow these.
50
+
51
+
### Commit messages
52
+
53
+
Add attribution using commit trailers such as `Co-authored-by:` (other projects use `Assisted-by:` or `Generated-by:`). For example:
54
+
55
+
```text
56
+
Your commit message here
57
+
58
+
Co-authored-by: GitHub Copilot
59
+
Co-authored-by: Claude
60
+
Co-authored-by: gemini-code-assist
61
+
Signed-off-by: Your Name <your.email@example.com>
62
+
```
63
+
64
+
65
+
## Development requirements
66
+
67
+
### Coding guide
68
+
- Always avoid adding new dependencies. Use the `extra_dependency_names` functionality if essential.
11
69
- Keep documentation of garak architecture in the docs/ dir up to date - though use docstrings in the first instance if possible.
12
70
- When working on probes, detectors, or buffs, be sure to check the content of the relevant `doc_uri` to understand the code's intent and the underlying technique.
13
71
- Use the payloads, data, and services mechanisms when suitable.
@@ -17,21 +75,25 @@ Due to the nature of the project, there is a lot of potentially harmful or dange
17
75
- Comply with docstring requirements - see the docs and also `tests/test_docs.py`.
18
76
- Catch specific exception types; avoid `except Exception` and bare `except:`.
19
77
20
-
## Dev environment tips
78
+
###Dev environment tips
21
79
- Use (and expect) only Python versions specified in `pyproject.toml`.
22
80
- Be sure you're using the right environment, with the right dependencies. Virtual environment management is preferred.
23
81
24
-
## Testing instructions
82
+
###Testing instructions
25
83
- Don't break existing tests.
26
84
- Add tests as you go.
27
85
- Tests for specific modules should go in a new file. For example, tests for `garak.probes.xyz` should go in `tests/probes/test_probe_xyz.py`.
28
86
- ARM, x86, and Windows all need to be supported - check the list of supported architectures in `pyproject.toml`.
87
+
- Don't add tests for default values given in configurable plugins.
88
+
- Don't add tests for functionality already covered by tests of parent classes.
89
+
- Add descriptive strings to asserts, explaining the expect underlying behaviour; be terse.
90
+
- Check that tests work. If `pytest` or other project dependencies are not available, the environment has not been set up correctly; give the user this problem.
29
91
30
-
## Code primitives
92
+
###Code primitives
31
93
- Avoid updating `attempt` or any base classes (`probes.base.*`, `generators.base.*`, `detectors.base.*`) frivolously.
32
94
- Consider using a service for content to be available across all of garak over a whole run.
33
95
34
-
## Style
96
+
###Style
35
97
- Comply with any repository formatting and linting config in `pyproject.toml`.
36
98
- Don't include default values in docstrings; the code is the documentation for these.
37
99
- Follow the visual design language of CLI output, including emojis and colour changes where in line with existing style.
* ``goal``: What is the probe trying to do? __e.g.__ ``"disregard the system prompt"``
125
+
* ``intent``: Which target behaviour / failure mode does this probe elicit? Must be a code from ``garak/data/cas/trait_typology.json`` __e.g.__ ``"T009ignore"``. The value is automatically propagated to every ``Attempt`` the probe creates. If the probe loads a payload that also declares an ``intent``, the payload's intent takes priority.
121
126
* ``primary_detector``: What ``Detector`` should your probe use?
122
127
123
128
.. code-block:: python
@@ -133,6 +138,7 @@ Many of these are decent defaults, though there are a few that we absolutely wan
133
138
"payload:jailbreak",
134
139
]
135
140
goal ="disregard the system prompt"
141
+
intent ="T009ignore"# the target behaviour elicited, from trait_typology.json
"intent": "S003productkeys", // optional; a code from the trait typology (garak/data/cas/trait_typology.json) describing the target behaviour these payloads are designed to elicit. When set, probes using this payload will propagate the intent to each Attempt, overriding the probe's default intent.
28
29
"detector_name": "productkey.Win5x5", // a suggested detector
29
30
"detector_config": {}, // a config dict of Configurable options for the detector
30
31
"payloads": [ // a list of strings: the payloads themselves
0 commit comments