Skip to content

Commit 8da5fdb

Browse files
committed
wip images
1 parent ae9c0bb commit 8da5fdb

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

docs/guardrails/images.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Images (WIP)
2+
3+
<div class='subtitle'>
4+
Guardrail the visual perception of your agentic system.
5+
</div>
6+
7+
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."
8+
9+
For security and privacy reasons, it is important to ensure that all visual information an agent processes is validated and well-scoped, to prevent exposure of sensitive information or inappropriate content.
10+
11+
Guardrails provide you a powerful way to enforce visual security policies, and to limit the agent's perception to only the visual information that is necessary and appropriate for the task at hand.
12+
13+
<div class='risks'/>
14+
> **Image Risks**<br/>
15+
> Since images are an agent's window to perceive the world, they can expose sensitive or inappropriate content. For example, an insecure vision agent could:
16+
17+
> * Capture personally identifiable information (PII) like names or addresses
18+
>
19+
> * View credentials such as passwords, API keys, or access tokens
20+
>
21+
> * Capture copyrighted material that shouldn't be processed or shared
22+
23+
## Checking Image Content
24+
25+
**Example**: Checking for PII in images
26+
27+
```python
28+
from invariant.parsers import ocr
29+
30+
raise "PII in image text" if:
31+
(img: Image)
32+
image_text := ocr(img)
33+
any(pii(image_text))
34+
```
35+
36+
**Example**: Check copyrighted material
37+
38+
39+
// Maybe something that uses the information in the image
40+
// So combine with like toolcalls?
41+
```python
42+
from ...
43+
44+
raise "Copyrighted text in image" if:
45+
(msg: Assistant)
46+
images := image(msg) # Extract all images in a single message
47+
copyright(ocr(images))
48+
```

0 commit comments

Comments
 (0)