Open
Conversation
Add a new API endpoint that allows mini apps to execute Python scripts server-side with a curated set of read-only tools. Changes: - Add MINI_APP_TOOL_ALLOWLIST with read-only tools (read, exec, psql_query, etc.) - Add miniAppExec function that creates user-scoped sandbox and executes code - Add POST /mini-apps/:id/exec endpoint to miniAppsRoutes - Wire up exec callback in AppServer with agentSystem dependency - Add tests for allowlist filtering and API routes The allowlist includes: - File reading: read, read_json - Shell execution: exec (sandboxed) - Database queries: psql_query, psql_db_list - Document reading: document_read, todo_list - Web search: exa_search - JSON utilities: json_parse, json_stringify - Observation/signal queries: observation_query, signal_events_csv Write operations and agent control tools are explicitly excluded.
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
This PR adds a new API endpoint that allows mini apps to execute Python scripts server-side with a curated set of read-only tools.
Changes
New Files
Modified Files
Tool Allowlist
The following read-only tools are available to mini apps:
Write operations and agent control tools are explicitly excluded.
Architecture
The implementation leverages the existing allowedToolNames field in ToolExecutionContext to filter available tools. The exec function creates a user-scoped sandbox with appropriate permissions and mounts, then executes the code through the existing RLM infrastructure.