feat(config): add tools.alsoAllow additive allowlist
This commit is contained in:
committed by
Pocket Clawd
parent
b9098f3401
commit
2ad3508a33
@@ -165,7 +165,9 @@ const FIELD_LABELS: Record<string, string> = {
|
||||
"tools.links.models": "Link Understanding Models",
|
||||
"tools.links.scope": "Link Understanding Scope",
|
||||
"tools.profile": "Tool Profile",
|
||||
"tools.alsoAllow": "Tool Allowlist Additions",
|
||||
"agents.list[].tools.profile": "Agent Tool Profile",
|
||||
"agents.list[].tools.alsoAllow": "Agent Tool Allowlist Additions",
|
||||
"tools.byProvider": "Tool Policy by Provider",
|
||||
"agents.list[].tools.byProvider": "Agent Tool Policy by Provider",
|
||||
"tools.exec.applyPatch.enabled": "Enable apply_patch",
|
||||
|
||||
@@ -140,12 +140,21 @@ export type ToolProfileId = "minimal" | "coding" | "messaging" | "full";
|
||||
|
||||
export type ToolPolicyConfig = {
|
||||
allow?: string[];
|
||||
/**
|
||||
* Additional allowlist entries merged into the effective allowlist.
|
||||
*
|
||||
* Intended for additive configuration (e.g., "also allow lobster") without forcing
|
||||
* users to replace/duplicate an existing allowlist or profile.
|
||||
*/
|
||||
alsoAllow?: string[];
|
||||
deny?: string[];
|
||||
profile?: ToolProfileId;
|
||||
};
|
||||
|
||||
export type GroupToolPolicyConfig = {
|
||||
allow?: string[];
|
||||
/** Additional allowlist entries merged into allow. */
|
||||
alsoAllow?: string[];
|
||||
deny?: string[];
|
||||
};
|
||||
|
||||
@@ -188,6 +197,8 @@ export type AgentToolsConfig = {
|
||||
/** Base tool profile applied before allow/deny lists. */
|
||||
profile?: ToolProfileId;
|
||||
allow?: string[];
|
||||
/** Additional allowlist entries merged into allow and/or profile allowlist. */
|
||||
alsoAllow?: string[];
|
||||
deny?: string[];
|
||||
/** Optional tool policy overrides keyed by provider id or "provider/model". */
|
||||
byProvider?: Record<string, ToolPolicyConfig>;
|
||||
@@ -312,6 +323,8 @@ export type ToolsConfig = {
|
||||
/** Base tool profile applied before allow/deny lists. */
|
||||
profile?: ToolProfileId;
|
||||
allow?: string[];
|
||||
/** Additional allowlist entries merged into allow and/or profile allowlist. */
|
||||
alsoAllow?: string[];
|
||||
deny?: string[];
|
||||
/** Optional tool policy overrides keyed by provider id or "provider/model". */
|
||||
byProvider?: Record<string, ToolPolicyConfig>;
|
||||
|
||||
@@ -150,6 +150,7 @@ export const SandboxPruneSchema = z
|
||||
export const ToolPolicySchema = z
|
||||
.object({
|
||||
allow: z.array(z.string()).optional(),
|
||||
alsoAllow: z.array(z.string()).optional(),
|
||||
deny: z.array(z.string()).optional(),
|
||||
})
|
||||
.strict()
|
||||
@@ -202,6 +203,7 @@ export const ToolProfileSchema = z
|
||||
export const ToolPolicyWithProfileSchema = z
|
||||
.object({
|
||||
allow: z.array(z.string()).optional(),
|
||||
alsoAllow: z.array(z.string()).optional(),
|
||||
deny: z.array(z.string()).optional(),
|
||||
profile: ToolProfileSchema,
|
||||
})
|
||||
@@ -231,6 +233,7 @@ export const AgentToolsSchema = z
|
||||
.object({
|
||||
profile: ToolProfileSchema,
|
||||
allow: z.array(z.string()).optional(),
|
||||
alsoAllow: z.array(z.string()).optional(),
|
||||
deny: z.array(z.string()).optional(),
|
||||
byProvider: z.record(z.string(), ToolPolicyWithProfileSchema).optional(),
|
||||
elevated: z
|
||||
@@ -425,6 +428,7 @@ export const ToolsSchema = z
|
||||
.object({
|
||||
profile: ToolProfileSchema,
|
||||
allow: z.array(z.string()).optional(),
|
||||
alsoAllow: z.array(z.string()).optional(),
|
||||
deny: z.array(z.string()).optional(),
|
||||
byProvider: z.record(z.string(), ToolPolicyWithProfileSchema).optional(),
|
||||
web: ToolsWebSchema,
|
||||
|
||||
Reference in New Issue
Block a user