arXiv:2609.09578cs.AISep 2026

Manuscript Offprint

arXiv:2609.09578

CityPlanner: A Sandbox Agent for Executable Urban Planning

Wentao Zhang, Jingyuan Wang, Zetong Zhou, Yifan Yang, Wenrui Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Urban planning is a real-world spatial optimization problem that requires selecting feasible actions from large candidate spaces under practical objectives such as cost and service quality. Existing optimization and reinforcement learning methods are effective for fixed formulations, but often depend on task-specific representations and constraint handling. We propose CityPlanner, a sandbox-agent framework for executable urban planning. CityPlanner introduces UrbanSandbox, a unified file-based environment where agents inspect task files, generate plans, run evaluators, and revise decisions based on executable feedback. To make learning tractable, we further propose atomic-task reinforcement learning, which decomposes long sandbox trajectories into BuildPlan for initial construction and ImprovePlan for feedback-based refinement. Experiments on a real-world benchmark show that CityPlanner consistently outperforms heuristic, task-specific RL, and general LLM-agent baselines. Ablations verify the contributions of UrbanSandbox, atomic-task RL, and iterative deployment. We release the code and dataset at https://anonymous.4open.science/r/co-agent-C1C8.

1 Introduction

Urban planning is a fundamental problem in city management. It converts spatial data, infrastructure conditions, and policy objectives into concrete decisions over land use, road construction, and public facilities (Zheng et al., 2025; Liu et al., 2025; Zheng et al., 2023; von Wahl et al., 2022; Liu et al., 2023). These decisions directly affect transportation efficiency, service accessibility, and ecological quality. From an optimization perspective, urban planning is challenging because it involves large combinatorial action spaces, hard feasibility constraints, and multiple competing objectives, such as construction cost and environmental benefit. The value of each planning action is also highly context-

Figure

Figure 1: Executable urban planning with CityPlanner.

dependent, as it depends on surrounding population, topology, and local demand patterns.

A large body of work has studied urban planning with optimization, heuristic search, and reinforcement learning methods (Rasheed et al., 2020; von Wahl et al., 2022; Zheng et al., 2023). These methods are effective when the state representation, action space, constraints, and objective function are fixed in advance. However, practical urban planning tasks are heterogeneous: different tasks may involve different candidate types, constraint definitions, evaluation procedures, and feedback forms. Methods designed for one task often require non-trivial redesign when transferred to another scenario, limiting their applicability.

Large language model agents provide a possible interface for such heterogeneous planning tasks. Instead of relying on a predefined vectorized state-action representation, an LLM agent can read task descriptions, inspect structured files, write intermediate analyses, execute tools, and revise solutions according to feedback (Yao et al., 2023; Shinn et al., 2023; Qin et al.; Patil et al.). Nevertheless, directly using an LLM as a black-box planner is insufficient for constrained urban planning. A generated plan must satisfy explicit feasibility constraints and be evaluated by task-specific programs rather than natural-language plausibility. The key question is how to leverage the broad capabilities of LLM to effectively solve urban planning problems.

In this paper, we formulate urban planning as an executable sandbox-agent problem. The agent is placed in a sandbox containing city data, candidate actions, task constraints, executable evaluators, and output interfaces. As shown in Fig. 1, the agent solves the task by reading input files, constructing a plan, running the evaluator, observing diagnostic feedback, and revising the plan. This formulation provides a common interaction protocol for heterogeneous urban planning tasks while preserving their task-specific objectives and constraints.

Training an LLM agent in such a sandbox remains non-trivial. Complete sandbox trajectories are long and noisy, containing repeated script execution, invalid submissions, and intermediate revisions. As the interaction proceeds, outdated observations and failed attempts accumulate in the context. Moreover, the main planning reward is usually available only after a complete plan is submitted and evaluated, leading to sparse rewards and difficult long-horizon credit assignment. Direct reinforcement learning over complete trajectories can therefore improve superficial executable behaviors while still failing to produce high-quality plans.

To address these issues, we propose CityPlanner, a sandbox-agent framework for executable urban planning. CityPlanner has two components. First, UrbanSandbox provides a unified file-based environment for heterogeneous planning tasks. The agent interacts with the environment through a minimal bash-based interface, enabling file inspection, plan generation, script execution, and evaluator invocation without task-specific agent APIs. Second, atomic-task reinforcement learning decomposes long-horizon sandbox planning into two finite-context tasks: BuildPlan, which constructs an initial feasible plan, and ImprovePlan, which revises an existing plan using evaluator diagnostics. At inference time, CityPlanner composes the two skills into an iterative procedure that repeatedly evaluates and improves the best-so-far solution.

For empirical evaluation, we collect real-world data from OpenStreetMap (OpenStreetMap contributors, 2017) and build an executable benchmark covering 5,670 planning instances across three tasks. Experiments show that CityPlanner consistently improves planning quality over heuristic, task-specific RL, and LLM-agent baselines, while ablations confirm the contributions of UrbanSandbox, atomic-task RL, and iterative refinement.

References (29)