github / github/copilot-sdk

Powershell scripts fail with "AuthorizationManager check failed" on Windows using MXC sandbox

Abierto
#2,594 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
10.5k
Forks
1.5k
Merge medio
1 d 11 h
PR fusionados (30 d)
128

Descripción

I've set up Copilot CLI to use the new MXC sandbox on Windows insiders.

## Issue
When the agent is trying to run a powershell script like `.\MyScript.ps1` it gets a sandbox error in return.
```powershell
AuthorizationManager check failed.
CategoryInfo: SecurityError
FullyQualifiedErrorId: UnauthorizedAccess
Exit code: 1
```

## Workaround
After some digging it seems to be causes by powershell not being able to read the registry, so it can't get the current execution profile.
I changed `.copilot\settings.json` to set the ExecutionPolicy at launch and that worked.
```json
{
...
"powershellFlags": [
"-NoProfile",
"-NoLogo",
"-ExecutionPolicy",
"RemoteSigned"
],
...
}
```

Not sure what is a good fix here. Maybe copilot should load the execution policy from the user profile and inject it directly instead of letting powershell try to read it from registry?

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproduce the failure on Windows Insiders with the MXC sandbox by running a .\MyScript.ps1 script. Start with .copilot/settings.json and the powershellFlags configuration, comparing the failing launch with the workaround using -NoProfile and -ExecutionPolicy RemoteSigned. Done means PowerShell scripts run without the AuthorizationManager error while the sandbox remains enabled.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
powershell
Área
operating-systems, security
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Necesita aclaración
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.