Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
23b6296
Added some autoguard guardrails
abhijitpal1247 Jan 8, 2024
10c56e8
Added factcheck and confidentiality detection
abhijitpal1247 Jan 9, 2024
54a5070
Added some unit tests
abhijitpal1247 Jan 22, 2024
2a56a04
Added some unit tests for confidential, jailbreak and toxicity guardr…
abhijitpal1247 Feb 2, 2024
463e615
cleaning up and some changes to the overall flow
abhijitpal1247 Feb 8, 2024
b64e18f
resolved previous issue with "tasks" param
abhijitpal1247 Feb 8, 2024
8162829
changed configuration for autoguard endpoint
abhijitpal1247 Feb 9, 2024
aacb3bd
removed unit tests of previous config and added factcheck unit test
abhijitpal1247 Feb 9, 2024
8f62a3f
added pii and topical guardrails
abhijitpal1247 Feb 12, 2024
3447f5d
added description for autoguard rails
abhijitpal1247 Feb 12, 2024
de60af2
added README.md and removed topical guardrail
abhijitpal1247 Feb 12, 2024
0486f01
removed unused imports
abhijitpal1247 Feb 12, 2024
7e896a3
resolved a small issue with the description
abhijitpal1247 Feb 13, 2024
6483f0f
added tonal_detection and changed text_toxicity flow
abhijitpal1247 Feb 15, 2024
e6f1f26
added advanced config to guardrails
abhijitpal1247 Feb 16, 2024
087d4a4
updated README.md
abhijitpal1247 Feb 16, 2024
a3e7bc5
added docstrings
abhijitpal1247 Feb 16, 2024
6ac38f6
changed the url
abhijitpal1247 Feb 16, 2024
819efc0
resolved issue with README.md
abhijitpal1247 Feb 19, 2024
d64cb10
renamed variable "matching_rules" to "matching_scores"
abhijitpal1247 Feb 19, 2024
2c633d9
added more details in README.md
abhijitpal1247 Feb 19, 2024
dd23c92
changed PII types
abhijitpal1247 Feb 21, 2024
523d173
fixed issues with PII redaction docs and added PII input & output int…
abhijitpal1247 Feb 23, 2024
30b7a1b
fixed issues with PII redaction docs and added PII input & output int…
abhijitpal1247 Feb 23, 2024
075ba0e
added changes for PII and README.md
abhijitpal1247 Feb 24, 2024
91a8ef4
updated README.md
abhijitpal1247 Feb 24, 2024
04b2999
added names to actions.py
abhijitpal1247 Feb 24, 2024
4779982
updated mock functions in test_autoguard_pii.py
abhijitpal1247 Feb 24, 2024
e616141
added mock functions in test_autoguard_pii.py
abhijitpal1247 Feb 24, 2024
705f356
added mock functions in test_autoguard_factcheck.py
abhijitpal1247 Feb 24, 2024
1f287b9
adds intellectual property
abhijitpal1247 Feb 29, 2024
4a90510
small documentation changes
abhijitpal1247 Feb 29, 2024
3b094c9
resolved issue with intellectual property test
abhijitpal1247 Feb 29, 2024
7dcfa07
added some more documentation for factcheck
abhijitpal1247 Feb 29, 2024
f9f2ae8
changed harm detection response
abhijitpal1247 Feb 29, 2024
f380d4d
added changes to show multi-guardrail output
abhijitpal1247 Feb 29, 2024
934a141
added changes to tests with multi guardrail output and a bit of chang…
abhijitpal1247 Feb 29, 2024
f685117
changed PII implementation and some tests
abhijitpal1247 Mar 1, 2024
e5b4dce
resolved issue with PII tests
abhijitpal1247 Mar 1, 2024
18c31ed
updated factcheck test docs
abhijitpal1247 Mar 1, 2024
f41e5ad
resolved some indentation issues
abhijitpal1247 Mar 1, 2024
2bc3289
added sample configurations
abhijitpal1247 Mar 1, 2024
d7336c3
some changes in sample kb
abhijitpal1247 Mar 1, 2024
b5e9a84
changes for gender bias response and sample config.yml
abhijitpal1247 Mar 1, 2024
6846556
pre-commit changes
abhijitpal1247 Mar 1, 2024
40f5513
pre-commit changes
abhijitpal1247 Mar 4, 2024
08dc408
some .co file changes
abhijitpal1247 Mar 4, 2024
c0bfe0b
some sample .co file changes
abhijitpal1247 Mar 4, 2024
fbce20d
some sample .co file changes
abhijitpal1247 Mar 4, 2024
e38ce00
some sample .co file changes - 2
abhijitpal1247 Mar 4, 2024
5be21cd
some sample .co file changes - 3
abhijitpal1247 Mar 4, 2024
3ffd2d0
changes in autoguard response
abhijitpal1247 Mar 5, 2024
aad0d56
some changes in sample .co file
abhijitpal1247 Mar 5, 2024
f791cfc
updated tests
abhijitpal1247 Mar 5, 2024
dd37c3e
some indentation changes
abhijitpal1247 Mar 5, 2024
d751edc
resolved issues with tests
abhijitpal1247 Mar 5, 2024
928daf1
removal of flows.co
abhijitpal1247 Mar 5, 2024
15777f2
change in sample flows
abhijitpal1247 Mar 5, 2024
c7de85b
resolves duplication issue in guardrail response
abhijitpal1247 Mar 6, 2024
db2e416
some small change in flows.co
abhijitpal1247 Mar 6, 2024
e3a5905
some small change in flows.co - 2
abhijitpal1247 Mar 6, 2024
e96a7c2
made changes to display output
abhijitpal1247 Mar 6, 2024
d701620
made changes to display output
abhijitpal1247 Mar 6, 2024
8d3642a
made changes to autoguard response
abhijitpal1247 Mar 6, 2024
cfa9bc7
made changes to sample config.yml
abhijitpal1247 Mar 6, 2024
0a8cb63
made in unit tests to support the output changes
abhijitpal1247 Mar 7, 2024
de1fdcd
revert to older test llms
abhijitpal1247 Mar 7, 2024
6400c43
Update README.md
rahm-decypher Mar 11, 2024
d933981
API KEY documentation in README.md
abhijitpal1247 Mar 12, 2024
10843b8
changes in API KEY documentation in README.md
abhijitpal1247 Mar 12, 2024
849e23d
Update README.md
rahm-decypher Mar 12, 2024
fd075d3
changed flows and moved files according to suggested changes
abhijitpal1247 Mar 26, 2024
84f1bff
resolving issues with tests
abhijitpal1247 Mar 26, 2024
fb59246
resolving issues with tests - 2
abhijitpal1247 Mar 26, 2024
37c5977
resolved issue with factcheck tests
abhijitpal1247 Mar 26, 2024
f2f2703
removed unnecessary variables
abhijitpal1247 Mar 26, 2024
d1f93d7
some doc changes
abhijitpal1247 Mar 26, 2024
ca63a89
removed factcheck input guardrail
abhijitpal1247 Mar 26, 2024
27769e8
refactored AutoGuard to AutoAlign
abhijitpal1247 Mar 27, 2024
00ba66b
refactored AutoGuard to AutoAlign-2
abhijitpal1247 Mar 27, 2024
816a116
refactored sample file name
abhijitpal1247 Mar 27, 2024
edebd42
adding retrieve relevant chunks action in flow
abhijitpal1247 Mar 27, 2024
f9e60d2
changing flow to subflow
abhijitpal1247 Mar 27, 2024
0629fac
some doc changes - 2
abhijitpal1247 Mar 27, 2024
6d6fb3c
Added suggested changes
abhijitpal1247 Jun 3, 2024
f218a7f
renamed the endpoints and changed the logging level
abhijitpal1247 Jun 3, 2024
2081dba
Fix issue with masking PII by input rail for AutoAlign.
drazvan Jun 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/user_guides/guardrails-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,28 @@ define flow
bot provide report answer
```


### AutoAlign

NeMo Guardrails provides an interface for using the AutoAlign's guardrails
(you need to have the `AUTOALIGN_API_KEY` environment variable set).


Following is the list of guardrails that are currently supported:
1. Gender bias Detection
2. Harm Detection
3. Jailbreak Detection
4. Confidential Detection
5. Intellectual property detection
6. Racial bias Detection
7. Tonal Detection
8. Toxicity detection
9. PII
10. Factcheck

More details regarding the configuration and usage of these can be found [here](../../nemoguardrails/library/autoalign/README.md).


## Other

### Jailbreak Detection Heuristics
Expand Down
10 changes: 10 additions & 0 deletions examples/configs/autoalign/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AutoAlign

This example showcases the use of AutoAlign guardrails.

The structure of the config folders is the following:
- `autoalign_config` - example configuration folder for all guardrails (except factcheck)
- `config.yml` - The config file holding all the configuration options.
- `autoalign_factcheck_config` - example configuration folder for AutoAlign's factcheck
- `kb` - The folder containing documents that form the knowledge base.
- `config.yml` - The config file holding all the configuration options.
73 changes: 73 additions & 0 deletions examples/configs/autoalign/autoalign_config/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
models:
- type: main
engine: openai
model: gpt-3.5-turbo
parameters:
temperature: 0.0
rails:
config:
autoalign:
parameters:
endpoint: "https://<AUTOALIGN_ENDPOINT>/guardrail"
input:
guardrails_config:
{
"pii_fast": {
"enabled_types": [
"[BANK ACCOUNT NUMBER]",
"[CREDIT CARD NUMBER]",
"[DATE OF BIRTH]",
"[DRIVER LICENSE NUMBER]",
"[EMAIL ADDRESS]",
"[IP ADDRESS]",
"[ORGANIZATION]",
"[PASSPORT NUMBER]",
"[PASSWORD]",
"[PERSON NAME]",
"[PHONE NUMBER]",
"[SOCIAL SECURITY NUMBER]",
"[SECRET_KEY]",
"[TRANSACTION_ID]"
],
},
"gender_bias_detection": {},
"harm_detection": {},
"text_toxicity_extraction": {},
"racial_bias_detection": {},
"jailbreak_detection": {},
"intellectual_property": {}
}
output:
guardrails_config:
{
"pii_fast": {
"enabled_types": [
"[BANK ACCOUNT NUMBER]",
"[CREDIT CARD NUMBER]",
"[DATE OF BIRTH]",
"[DRIVER LICENSE NUMBER]",
"[EMAIL ADDRESS]",
"[IP ADDRESS]",
"[ORGANIZATION]",
"[PASSPORT NUMBER]",
"[PASSWORD]",
"[PERSON NAME]",
"[PHONE NUMBER]",
"[SOCIAL SECURITY NUMBER]",
"[SECRET_KEY]",
"[TRANSACTION_ID]"
],
},
"gender_bias_detection": {},
"harm_detection": {},
"text_toxicity_extraction": {},
"racial_bias_detection": {},
"jailbreak_detection": {},
"intellectual_property": {}
}
input:
flows:
- autoalign check input
output:
flows:
- autoalign check output
12 changes: 12 additions & 0 deletions examples/configs/autoalign/autoalign_factcheck_config/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
models:
- type: main
engine: openai
model: gpt-3.5-turbo
rails:
config:
autoalign:
parameters:
fact_check_endpoint: "https://<AUTOALIGN_ENDPOINT>/factcheck"
output:
flows:
- autoalign factcheck output
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pluto (minor-planet designation: 134340 Pluto) is a dwarf planet in the Kuiper belt, a ring of bodies beyond the orbit of Neptune. It is the ninth-largest and tenth-most-massive known object to directly orbit the Sun. It is the largest known trans-Neptunian object by volume, by a small margin, but is slightly less massive than Eris. Like other Kuiper belt objects, Pluto is made primarily of ice and rock and is much smaller than the inner planets. Pluto has only one sixth the mass of Earth's moon, and one third its volume. Pluto was recognized as a planet until 2006. Pluto has a moderately eccentric and inclined orbit, ranging from 30 to 49 astronomical units (4.5 to 7.3 billion kilometers; 2.8 to 4.6 billion miles) from the Sun. Light from the Sun takes 5.5 hours to reach Pluto at its orbital distance of 39.5 AU (5.91 billion km; 3.67 billion mi). Pluto's eccentric orbit periodically brings it closer to the Sun than Neptune, but a stable orbital resonance prevents them from colliding. Pluto has five known moons: Charon, the largest, whose diameter is just over half that of Pluto; Styx; Nix; Kerberos; and Hydra. Pluto and Charon are sometimes considered a binary system because the barycenter of their orbits does not lie within either body, and they are tidally locked. The New Horizons mission was the first spacecraft to visit Pluto and its moons, making a flyby on July 14, 2015 and taking detailed measurements and observations.
5 changes: 0 additions & 5 deletions mypy.ini

This file was deleted.

Loading