Add browser and computer use configuration (#40018)

## What changed

- Add typed `browser_use` settings for history access and per-origin access,
  download, upload, and full CDP policies.
- Add typed `computer_use` settings for default app access, macOS bundle IDs,
  Windows AUMIDs, and Windows executable identities.
- Expose the merged settings through app-server config reads and generated
  Rust, TypeScript, and JSON schemas.

## Testing

- Cover TOML serialization round trips, layered config reads with origin
  metadata, and app-server batch writes.

GitOrigin-RevId: 78065f6fec990602071fc81ff639ff97f7ad8cd5
This commit is contained in:
rafael-oai authored and copyberry committed 2026-08-21 21:41:55 +00:00
1 parent be6ebb1f6d
commit 95118dff65
27 files changed
+1481 -2

No files matched your search

@@ -0,0 +1,25 @@
use super::AllowDenyRequirement;
use crate::JsonSchema;
use crate::TS;
use serde::Deserialize;
use serde::Serialize;
use std::collections::BTreeMap;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
#[ts(export_to = "v2/")]
pub struct BrowserUseConfig {
pub allow_history_access: Option<bool>,
pub default_origin_policy: Option<BrowserUseOriginPolicyConfig>,
pub origins: Option<BTreeMap<String, BrowserUseOriginPolicyConfig>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
#[ts(export_to = "v2/")]
pub struct BrowserUseOriginPolicyConfig {
pub access: Option<AllowDenyRequirement>,
pub downloads: Option<AllowDenyRequirement>,
pub uploads: Option<AllowDenyRequirement>,
pub full_cdp_access: Option<AllowDenyRequirement>,
}
@@ -0,0 +1,40 @@
use super::AllowDenyRequirement;
use crate::JsonSchema;
use crate::TS;
use serde::Deserialize;
use serde::Serialize;
use std::collections::BTreeMap;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
#[ts(export_to = "v2/")]
pub struct ComputerUseConfig {
pub default_app_access: Option<AllowDenyRequirement>,
pub macos: Option<ComputerUseMacosConfig>,
pub windows: Option<ComputerUseWindowsConfig>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
#[ts(export_to = "v2/")]
pub struct ComputerUseMacosConfig {
pub bundle_ids: Option<BTreeMap<String, AllowDenyRequirement>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
#[ts(export_to = "v2/")]
pub struct ComputerUseWindowsConfig {
pub aumids: Option<BTreeMap<String, AllowDenyRequirement>>,
pub exes: Option<Vec<ComputerUseWindowsExeConfig>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
#[ts(export_to = "v2/")]
pub struct ComputerUseWindowsExeConfig {
pub publisher_name: String,
pub product_name: String,
pub binary_name: Option<String>,
pub access: AllowDenyRequirement,
}
@@ -1,5 +1,7 @@
use super::ApprovalsReviewer;
use super::AskForApproval;
use super::BrowserUseConfig;
use super::ComputerUseConfig;
use super::SandboxMode;
use super::WindowsSandboxSetupMode;
use super::shared::default_enabled;
@@ -282,6 +284,8 @@ pub struct Config {
#[experimental("config/read.apps")]
#[serde(default)]
pub apps: Option<AppsConfig>,
pub browser_use: Option<BrowserUseConfig>,
pub computer_use: Option<ComputerUseConfig>,
pub desktop: Option<HashMap<String, JsonValue>>,
#[serde(default, flatten)]
pub additional: HashMap<String, JsonValue>,
@@ -4,8 +4,10 @@ mod account;
mod apps;
mod attestation;
mod bedrock;
mod browser_use_config;
mod collaboration_mode;
mod command_exec;
mod computer_use_config;
mod config;
mod current_time;
mod diagnostics;
@@ -36,8 +38,10 @@ pub use account::*;
pub use apps::*;
pub use attestation::*;
pub use bedrock::*;
pub use browser_use_config::*;
pub use collaboration_mode::*;
pub use command_exec::*;
pub use computer_use_config::*;
pub use config::*;
pub use current_time::*;
pub use diagnostics::*;
@@ -1996,6 +1996,8 @@ fn config_granular_approval_policy_is_marked_experimental() {
service_tier: None,
analytics: None,
apps: None,
browser_use: None,
computer_use: None,
desktop: None,
additional: HashMap::new(),
});
@@ -2029,6 +2031,8 @@ fn config_approvals_reviewer_is_marked_experimental() {
service_tier: None,
analytics: None,
apps: None,
browser_use: None,
computer_use: None,
desktop: None,
additional: HashMap::new(),
});