If you plan to eat what you grow, the short answer is yes: urban planter boxes can be safe for herbs and vegetables, but safety depends less on the fact that they are in a city and more on what the box is made of, what you fill it with, where you put it, and how you manage it. Most concerns come from contaminants such as lead, arsenic, cadmium, or chemicals from treated wood, old paint, contaminated soil, dust, or water.
Start with the container material. Untreated wood such as cedar, redwood, or cypress is generally a good choice. Avoid old pressure-treated wood, especially CCA-treated wood made before the mid-2000s, because it may contain arsenic. Creosote-treated railroad ties should also be avoided for food gardening. Newer pressure-treated wood is less likely to contain arsenic, but it is still best not to let edible soil touch it directly. Line the inside with food-grade HDPE plastic or use a separate inner container. Food-grade plastic, HDPE, grow bags, fabric pots, and glazed ceramic containers are usually safe. Avoid unknown recycled plastics, PVC, and containers that once held motor oil, pesticides, or industrial chemicals.
Galvanized metal can be used, but zinc may leach into soil, especially if the soil is acidic. If you use galvanized boxes, keep soil pH closer to neutral and consider a liner. Old paint is a bigger concern. Lead paint can contaminate soil and dust, so do not grow food in a painted box if the paint is peeling, chalking, or from an older building. If you want to keep the box, seal it safely or line it.
The soil and compost matter just as much as the box. Use clean topsoil, compost, and potting mix from reputable sources. Avoid digging soil from near old buildings, busy roads, driplines, painted structures, or industrial sites unless you have it tested. A soil test for lead, cadmium, arsenic, and pH is inexpensive insurance. If tests show high lead or other heavy metals, do not try to fix it with a little compost. Replace the soil or use a raised bed with clean soil and a liner.
Location also affects safety. Place planter boxes away from peeling paint, old windows, busy roads, construction dust, and areas where rainwater runoff collects. If you garden on a balcony, windblown dust can still settle on leaves, so wash produce well. Keep the area clean and avoid tracking contaminated soil into the box.
Different plants take up contaminants differently. Leafy greens and root crops can hold more soil particles and may need extra washing or peeling. Fruiting crops such as tomatoes, peppers, cucumbers, and squash tend to be lower risk because they do not usually take up large amounts of lead into the fruit. Herbs are generally fine if grown in clean soil and washed before eating. Always wash all produce under running water, discard outer leaves, and peel root vegetables like carrots, beets, and potatoes.
Practical steps: choose food-safe containers or line them with HDPE; use clean soil and compost; test soil if you are unsure; keep soil pH near neutral; avoid treated wood, lead paint, and unknown plastics; wash hands and produce; and peel root crops. If you suspect contamination, replace the soil or switch to grow bags.
Bottom line: urban planter boxes can be a safe and productive way to grow herbs and vegetables you plan to eat. Choose safe materials, use clean soil, avoid known contamination sources, and wash your harvest. If you are uncertain about your soil or container, a soil test and a simple liner are smart, low-cost precautions.