Skip to content

Commit 1b451fa

Browse files
Alex Holmbergclaude
authored andcommitted
fix(11.3-01): add is_public parameter with safe default (false)
The agent was deploying all services as public without asking the user. Now: 1. Added is_public parameter to DeployServiceArgs (default: false) 2. Preview shows is_public with clear explanation: - "Service will be INTERNAL only (not accessible from internet)" - "Service will be PUBLICLY accessible from the internet" 3. Uses args.is_public when creating deployment config This ensures services are internal by default for safety, and the agent must explicitly show and confirm public access with the user. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7cf24ef commit 1b451fa

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

src/agent/tools/platform/deploy_service.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ pub struct DeployServiceArgs {
3535
pub region: Option<String>,
3636
/// Optional: override detected port
3737
pub port: Option<u16>,
38+
/// Whether to make the service publicly accessible (default: false for safety)
39+
/// Internal services can only be accessed within the cluster/network
40+
#[serde(default)]
41+
pub is_public: bool,
3842
/// If true (default), show recommendation but don't deploy yet
3943
/// If false with settings, deploy immediately
4044
#[serde(default = "default_preview")]
@@ -101,8 +105,14 @@ Uses provided overrides or recommendation defaults to deploy immediately.
101105
- machine_type: Override machine selection (e.g., cx22, e2-small)
102106
- region: Override region selection (e.g., nbg1, us-central1)
103107
- port: Override detected port
108+
- is_public: Whether service should be publicly accessible (default: false)
104109
- preview_only: If true (default), show recommendation only
105110
111+
**IMPORTANT - Public vs Internal:**
112+
- is_public=false (default): Service is internal-only, not accessible from internet
113+
- is_public=true: Service gets a public URL, accessible from anywhere
114+
- ALWAYS show this in the preview and ask user before deploying public services
115+
106116
**What it analyzes:**
107117
- Programming language and framework
108118
- Port configuration from source code, package.json, Dockerfiles
@@ -150,6 +160,10 @@ User: "deploy this service"
150160
"type": "integer",
151161
"description": "Override: port to expose"
152162
},
163+
"is_public": {
164+
"type": "boolean",
165+
"description": "Whether service should be publicly accessible. Default: false (internal only). Set to true for public URL."
166+
},
153167
"preview_only": {
154168
"type": "boolean",
155169
"description": "If true (default), show recommendation only. If false, deploy."
@@ -419,6 +433,12 @@ User: "deploy this service"
419433
"region_reasoning": recommendation.region_reasoning,
420434
"port": recommendation.port,
421435
"health_check_path": recommendation.health_check_path,
436+
"is_public": args.is_public,
437+
"is_public_note": if args.is_public {
438+
"Service will be PUBLICLY accessible from the internet"
439+
} else {
440+
"Service will be INTERNAL only (not accessible from internet)"
441+
},
422442
"confidence": recommendation.confidence,
423443
},
424444
"alternatives": {
@@ -648,7 +668,7 @@ User: "deploy this service"
648668
&final_provider,
649669
&final_region,
650670
&final_machine,
651-
true, // is_public
671+
args.is_public,
652672
recommendation.health_check_path.as_deref(),
653673
);
654674

@@ -669,7 +689,7 @@ User: "deploy this service"
669689
cluster_id: None, // Cloud Runner doesn't need cluster
670690
registry_id: None, // Auto-provision
671691
auto_deploy_enabled: true,
672-
is_public: Some(true),
692+
is_public: Some(args.is_public),
673693
cloud_runner_config: Some(cloud_runner_config),
674694
};
675695

0 commit comments

Comments
 (0)