2025-05-07 20:03:29 -07:00
|
|
|
(version 1)
|
|
|
|
|
|
|
|
|
|
;; allow everything by default
|
|
|
|
|
(allow default)
|
|
|
|
|
|
2025-05-08 11:28:45 -07:00
|
|
|
;; deny all writes EXCEPT under specific paths
|
2025-05-07 20:03:29 -07:00
|
|
|
(deny file-write*)
|
|
|
|
|
(allow file-write*
|
|
|
|
|
(subpath (param "TARGET_DIR"))
|
|
|
|
|
(subpath (param "TMP_DIR"))
|
2025-05-29 15:06:09 -07:00
|
|
|
(subpath (param "CACHE_DIR"))
|
2025-05-08 11:28:45 -07:00
|
|
|
(subpath (string-append (param "HOME_DIR") "/.gemini"))
|
|
|
|
|
(subpath (string-append (param "HOME_DIR") "/.npm"))
|
2025-05-09 09:02:14 -07:00
|
|
|
(subpath (string-append (param "HOME_DIR") "/.cache"))
|
2025-05-23 07:56:43 -07:00
|
|
|
(subpath (string-append (param "HOME_DIR") "/.gitconfig"))
|
2025-05-07 20:03:29 -07:00
|
|
|
(literal "/dev/stdout")
|
|
|
|
|
(literal "/dev/stderr")
|
|
|
|
|
(literal "/dev/null")
|
2025-06-10 08:58:37 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
;; deny all inbound network traffic EXCEPT on debugger port
|
|
|
|
|
(deny network-inbound)
|
|
|
|
|
(allow network-inbound (local ip "localhost:9229"))
|
|
|
|
|
|
|
|
|
|
;; deny all outbound network traffic EXCEPT through proxy on localhost:8877
|
|
|
|
|
;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
|
2025-06-11 11:31:38 -07:00
|
|
|
;; proxy must listen on :::8877 (see scripts/example-proxy.js)
|
2025-06-10 08:58:37 -07:00
|
|
|
(deny network-outbound)
|
|
|
|
|
(allow network-outbound (remote tcp "localhost:8877"))
|
|
|
|
|
|
|
|
|
|
(allow network-bind (local ip "*:*"))
|