pub enum PermissionPolicy {
DenyAll,
AutoApprove,
}Expand description
Policy for handling permission requests from the Copilot runtime.
Controls whether tool-execution permission prompts are auto-approved or denied.
Denies by default. The runtime’s own tools — shell, git, file editing —
run as the host’s user, with the runtime’s GitHub credential and the part
of the host’s environment runtime_env_keys lets through, in the session
working directory (a scratch directory unless the host configures one), so a host
that builds its prompt from untrusted input (an end user’s chat text, say)
turns an approval into arbitrary execution next to its secrets. That is not a
hypothetical: a Dravr coaching turn was observed making five shell/bash/
Grep/Glob calls during a user’s request, because the default approved them.
A host that genuinely wants the runtime to run tools must now say so
explicitly with PermissionPolicy::AutoApprove. Every current consumer
wants denial, and the safe value should not depend on each one remembering to
set an env var.
Variants§
DenyAll
Deny all permission requests by cancelling them.
AutoApprove
Automatically approve permission requests by selecting the best allow option.
Only safe when the prompt is fully trusted — never when it is assembled from end-user input.
Implementations§
Trait Implementations§
Source§impl Clone for PermissionPolicy
impl Clone for PermissionPolicy
impl Copy for PermissionPolicy
Source§impl Debug for PermissionPolicy
impl Debug for PermissionPolicy
Source§impl Default for PermissionPolicy
impl Default for PermissionPolicy
impl Eq for PermissionPolicy
Source§impl PartialEq for PermissionPolicy
impl PartialEq for PermissionPolicy
impl StructuralPartialEq for PermissionPolicy
Auto Trait Implementations§
impl Forget for PermissionPolicy
impl Freeze for PermissionPolicy
impl Move for PermissionPolicy
impl RefUnwindSafe for PermissionPolicy
impl Send for PermissionPolicy
impl Sync for PermissionPolicy
impl Unpin for PermissionPolicy
impl UnsafeUnpin for PermissionPolicy
impl UnwindSafe for PermissionPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.