Download codex-rs/core/src/guardian/coverage.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/core/src/guardian/coverage.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/core/src/guardian/coverage.rs
-
curl -L -o coverage.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/core/src/guardian/coverage.rs
1.41 kB
| //! Supplies action categories to the review extension and enforces host-owned requirements. | |
| use super::GuardianApprovalRequest; | |
| use crate::tools::sandboxing::ApprovalAction; | |
| use codex_protocol::openai_models::GuardianScope; | |
| impl GuardianApprovalRequest { | |
| pub(crate) fn guardian_scope(&self) -> GuardianScope { | |
| match self { | |
| Self::ExecCommand { .. } | Self::WriteStdin { .. } => GuardianScope::Shell, | |
| Self::Execve { .. } => GuardianScope::Shell, | |
| Self::ApplyPatch { .. } => GuardianScope::FileChanges, | |
| Self::McpToolCall { server, .. } => GuardianScope::for_mcp_server(server), | |
| Self::NetworkAccess { .. } => GuardianScope::Network, | |
| Self::RequestPermissions { .. } => GuardianScope::Permissions, | |
| } | |
| } | |
| } | |
| impl ApprovalAction { | |
| pub(crate) fn guardian_scope(&self) -> GuardianScope { | |
| match self { | |
| Self::ExecCommand { .. } | Self::WriteStdin { .. } => GuardianScope::Shell, | |
| Self::Execve { .. } => GuardianScope::Shell, | |
| Self::ApplyPatch { .. } => GuardianScope::FileChanges, | |
| Self::McpToolCall { server, .. } => GuardianScope::for_mcp_server(server), | |
| Self::NetworkAccess { .. } => GuardianScope::Network, | |
| Self::RequestPermissions { .. } => GuardianScope::Permissions, | |
| } | |
| } | |
| } | |