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: docs/guardrails/copyright.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ title: Copyrighted Content
7
7
Copyright Compliance in Agentic Systems
8
8
</div>
9
9
10
-
It is important to ensure that content generated by agentic systems respects intellectual property rights and avoids the unauthorized use of copyrighted material. Copyright compliance is essential not only for legal and ethical reasons, but also to protect users and organizations from liability and reputational risk.
10
+
It is important to ensure that content generated by agentic systems respects intellectual property rights and avoids the unauthorized use of copyrighted material. Copyright compliance is essential not only for legal and ethical reasons but also to protect users and organizations from liability and reputational risk.
11
11
12
12
Guardrails provides the `copyright` function to detect if any licenses are present in a given piece of text, to protect against exactly this.
13
13
@@ -32,7 +32,7 @@ Detects copyrighted text material if it is in `data` and returns the detected li
32
32
|`List[str]`| List of detected copyright types. For example, `["GNU_AGPL_V3", "MIT_LICENSE", ...]`|
33
33
34
34
### Detecting copyrighted content
35
-
The simplest use-case of the `copyright` function is to apply it directly to messages, as seen below.
35
+
The simplest use-case of the `copyright` function is to apply it to all messages, as seen below.
Copy file name to clipboardExpand all lines: docs/guardrails/images.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ description: Secure images given to, or produced by, your agentic system.
6
6
# Images
7
7
8
8
<divclass='subtitle'>
9
-
Secure images given to, or produced by, your agentic system.
9
+
Secure images given to, or produced by your agentic system.
10
10
</div>
11
11
12
12
At the core of computer vision agents is the ability to perceive their environment through images, typically by taking screenshots to assess the current state. This visual perception allows agents to understand interfaces, identify interactive elements, and make decisions based on what they "see."
@@ -49,7 +49,7 @@ Given an image as input, this parser extracts and returns the text in the image
49
49
|`List[str]`| A list of extracted pieces of text from`data`. |
50
50
51
51
### Analyzing Text in Images
52
-
The `ocr` function is a <span class="parser-badge" size-mod="small"></span> so it returns the data found from parsing its content; in this case any text present in an image will be extracted. The extracted text can then be used for further detection, for example detecting a prompt injection in an image, like the example below.
52
+
The `ocr` function is a <span class="parser-badge" size-mod="small"></span> so it returns the data found from parsing its content; in this case,any text present in an image will be extracted. The extracted text can then be used for further detection, for example detecting a prompt injection in an image, like the example below.
Copy file name to clipboardExpand all lines: docs/guardrails/pii.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,15 @@ description: Detect and manage PII in traces.
8
8
Detect and manage PII in traces.
9
9
</div>
10
10
11
-
Personally Identifiable Information (PII) refers to sensitive information — like names, emails, or credit card numbers — that AI systems and agents need to handle carefully. When these systems work with user data, it is important to establish clear rules about how personal information can be handled, to ensure the sytem functions safely.
11
+
Personally Identifiable Information (PII) refers to sensitive information — like names, emails, or credit card numbers — that AI systems and agents need to handle carefully. When these systems work with user data, it is important to establish clear rules about how personal information can be handled, to ensure the system functions safely.
12
12
13
13
<divclass='risks'/>
14
14
> **PII Risks**<br/>
15
15
> Without safeguards, agents may:
16
16
17
17
> ***Log PII** in traces or internal tools
18
18
>
19
-
> ***Expose PII**to in unintentional or dangerous ways
19
+
> ***Expose PII** in unintentional or dangerous ways
20
20
>
21
21
> ***Share PII** in responses or external tool calls
22
22
@@ -29,13 +29,13 @@ def pii(
29
29
entities: Optional[List[str]]
30
30
) -> List[str]
31
31
```
32
-
Detector to find personally-identifiable information in text.
32
+
Detector to find personallyidentifiable information in text.
|`data`|`Union[str, List[str]]`| A single message or a list of messages to detect PIIin. |
38
+
|`data`|`Union[str, List[str]]`| A single message or a list of messages. |
39
39
|`entities`|`Optional[List[str]]`| A list of [PII entity types](https://microsoft.github.io/presidio/supported_entities/) to detect. Defaults to detecting all types. |
40
40
41
41
**Returns**
@@ -172,7 +172,7 @@ raise "Found Credit Card information in message" if:
172
172
173
173
174
174
### Preventing PII Leakage
175
-
It is also possible to use the `pii` function in combination with other filters to get more complex behaviour. The example below shows how you can detect when an agent attempts to send emails outside of your organisation.
175
+
It is also possible to use the `pii` function in combination with other filters to get more complex behavior. The example below shows how you can detect when an agent attempts to send emails outside of your organisation.
176
176
177
177
**Example:** Detecting PII Leakage in External Communications.
Copy file name to clipboardExpand all lines: docs/guardrails/secrets.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ title: Secret Tokens and Credentials
7
7
Prevent agents from leaking sensitive keys, tokens, and credentials.
8
8
</div>
9
9
10
-
Agentic systems often operate on user data, call APIs, or interface with tools and environments that require access credentials. If not properly guarded, these credentials — such as API keys, access tokens, or database secrets — can be accidentally exposed through system outputs, logs, or responses to user prompts.
10
+
Agentic systems often operate on user data, call APIs, or interface with tools and environments that require access credentials. If not adequately guarded, these credentials — such as API keys, access tokens, or database secrets — can be accidentally exposed through system outputs, logs, or responses to user prompts.
11
11
12
12
This section describes how to detect and prevent the unintentional disclosure of secret tokens and credentials during agent execution.
13
13
@@ -61,12 +61,12 @@ raise "Found Secrets" if:
61
61
### Detecting specific secret types
62
62
In some cases, you may want to detect only certain types of secrets—such as API keys for a particular service. Since the `secrets` detector returns a list of all matched secret types, you can check whether a specific type is present in the trace and handle it accordingly.
63
63
64
-
**Example:** Detecting a github token in messages
64
+
**Example:** Detecting a GitHub token in messages
65
65
```python
66
66
from invariant.detectors import secrets
67
67
68
68
raise"Found Secrets"if:
69
69
(msg: Message)
70
70
"GITHUB_TOKEN"in secrets(msg)
71
71
```
72
-
<divclass="code-caption">Specifically check for github tokens in any message.</div>
72
+
<divclass="code-caption">Specifically check for GitHub tokens in any message.</div>
0 commit comments