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/docs/why-rego.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,12 @@ Rego is a **declarative language** designed specifically for expressing policy l
21
21
# Declarative: "deny if command contains rm -rf and targets root"
22
22
deny contains decision if {
23
23
input.tool_name == "Bash"
24
-
contains(input.tool_input.command, "rm -rf")
25
-
startswith(input.tool_input.command, "rm -rf /")
24
+
contains(input.tool_input.command, "rm -rf /")
26
25
}
27
26
```
28
27
28
+
_\*this is a simple policy, in critical scenarios you would write a more robust version_
29
+
29
30
This declarative approach makes policies **easier to read** and audit and **self-documenting.** Teams deploying agents further benefit from policy being unambiguous; the policy logic is separated from the application code.
0 commit comments