Merged
Conversation
Scripts now authenticate via HMAC-signed tokens scoped to their flow/session. Tokens auto-revoke on exit and have limited permissions.
Contributor
🚀 Preview DeploymentYour changes have been deployed to: 📖 Docs: https://docs-pr-11.t-req.io This preview will be automatically removed when the PR is closed. |
Greptile OverviewGreptile SummaryThis PR implements scoped script token authentication to enable server-spawned scripts to make authenticated API requests with limited privileges. The implementation adds whitelisted script and test runners with comprehensive security controls. Key Changes:
Security Model:
PR Template Issues:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Client as Web UI or TUI
participant API as API Server
participant AuthLayer as Authorization
participant Service
participant Runner as Script Runner
participant Script as User Script
User->>Client: Click Run Script
Client->>API: Request runners
AuthLayer->>AuthLayer: Verify user
API->>Service: getRunners
Service->>Runner: detectRunner
Runner-->>Client: runner options
Client->>API: Create flow
API->>Service: createFlow
Service-->>Client: flow identifier
Client->>API: Run script request
AuthLayer->>AuthLayer: Check permissions
Note over AuthLayer: Prevents nested spawning
API->>Service: executeScript
Service->>AuthLayer: Generate limited scope
AuthLayer-->>Service: temporary access
Service->>Runner: spawn script
Runner->>Script: start process
Runner-->>Client: execution identifier
Client->>API: Subscribe events
Script->>API: Execute HTTP request
AuthLayer->>AuthLayer: Validate scope
Note over AuthLayer: Enforces flow and session scope
API->>Service: process request
Service-->>Script: HTTP response
Script->>Script: Complete
Runner->>AuthLayer: Cleanup access
Runner->>Service: Exit handler
Service-->>Client: Completion event
|
andrewmelchor
added a commit
that referenced
this pull request
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add scoped authentication tokens for server-spawned scripts (JavaScript/TypeScript/Python). Instead of passing the main server token
to scripts, the server now generates short-lived, HMAC-signed tokens that are scoped to specific flows and sessions. This implements
the principle of least privilege - script tokens can only:
Scripts are blocked from administrative operations (creating/deleting sessions, spawning nested scripts, accessing config, enumerating
workspace files).
Also adds web UI support for running scripts with the same security model.
Type of Change
How Has This Been Tested?
Checklist