Implement granular tool permissions (#82)

* Granular tool permissions

* Fix build

* Start on UI

* Fixes

* Fmt

* Go ham on UI

* Update migrations

* Considate wiki files

* Clean up

* More tweaks. Docs.

* Consolidate collab and noncollab

* Fix build

* Restrict for non-collaborators
This commit is contained in:
Colin McDonnell
2026-01-15 08:05:30 +00:00
committed by pullfrog[bot]
parent 4547b0032e
commit 97dce099c1
29 changed files with 800 additions and 2052 deletions
+22 -6
View File
@@ -56,6 +56,14 @@ export type AgentApiKeyName = (typeof agentsManifest)[AgentName]["apiKeyNames"][
export const Effort = type.enumerated("mini", "auto", "max");
export type Effort = typeof Effort.infer;
// tool permission types shared with server dispatch
export type ToolPermission = "disabled" | "enabled";
export type BashPermission = "disabled" | "restricted" | "enabled";
// permission level for the author who triggered the event
// matches GitHub's permission levels: admin > write > maintain > triage > read > none
export type AuthorPermission = "admin" | "maintain" | "write" | "triage" | "read" | "none";
// base interface for common payload event fields
interface BasePayloadEvent {
issue_number?: number;
@@ -83,6 +91,8 @@ interface BasePayloadEvent {
url: string;
};
comment_ids?: number[] | "all";
/** permission level of the user who triggered this event */
authorPermission?: AuthorPermission;
[key: string]: any;
}
@@ -247,18 +257,24 @@ export type PayloadEvent =
| UnknownEvent;
export interface DispatchOptions {
/**
* Sandbox mode flag - when true, restricts agent to read-only operations
* (no Write, Web, or Bash access)
*/
readonly sandbox?: boolean;
/**
* When true, disables progress comment (no "leaping into action" comment, no report_progress tool)
*/
readonly disableProgressComment?: true;
/**
* Granular tool permissions set server-side for dispatch workflows.
*/
readonly web?: ToolPermission;
readonly search?: ToolPermission;
readonly write?: ToolPermission;
readonly bash?: BashPermission;
}
export type MutableDispatchOptions = {
-readonly [K in keyof DispatchOptions]: DispatchOptions[K];
};
// payload type for agent execution
export interface Payload extends DispatchOptions {
"~pullfrog": true;