---
title: "Discussion on \"Agents Zero to Hero #12: Building AI Subagents with Context Isolation\" | Hashnode"
description: "Discussion on \"Agents Zero to Hero #12: Building AI Subagents with Context Isolation\". Learn how to build AI agent subagents in Python using scoped delegation, isolated context, shared tools, permissions, and depth guards."
url: "https://hashnode.com/posts/agents-zero-to-hero-12-building-ai-subagents-with-context-isolation/6ab141e5635992281f15c328"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Agents Zero to Hero #12: Building AI Subagents with Context Isolation](https://nik-hil.hashnode.dev/agents-zero-to-hero-12-building-ai-subagents-with-context-isolation?utm_source=hashnode&utm_medium=feed)

Learn how to build AI agent subagents in Python using scoped delegation, isolated context, shared tools, permissions, and depth guards.

Sep 21 · 20 min read · nik-hil.hashnode.dev  
Updated Sep 25  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#llm](https://hashnode.com/tag/llm)
-   [#python](https://hashnode.com/tag/python)
-   [#software-development](https://hashnode.com/tag/software-development)
-   [#multi-agent-systems](https://hashnode.com/tag/multi-agent-systems)
-   [#mas](https://hashnode.com/tag/mas)

## Written by

[Nikhil Ikhar](https://hashnode.com/@TechNikhil)

@TechNikhil · Earth

  
[View profile](https://hashnode.com/@TechNikhil)

Explore Learn Build AI products

## Responses 1

Markdown supported · ⌘↵ to post

[Mihai\_LeanZero](https://hashnode.com/@mihaileanzero)

[Sep 21](https://hashnode.com/posts/agents-zero-to-hero-12-building-ai-subagents-with-context-isolation/6ab141e5635992281f15c328/comment/6ab18c9730919eed1ce26ebd)

The shared-workspace-isolated-context split is the right call for governance, but it raises a real question once a parent fires more than one child at a task: if two subagents run against the same workspace, is there any locking around file writes, or does run\_agent() stay strictly sequential per parent for now? The depth guard stops a child from recursing, but nothing stops a parent from spawning two children back to back into the same tree, and if they touch overlapping files the last write wins without either child ever knowing the other existed. Worth stating explicitly whether v0.12 assumes sequential-only delegation or whether parallel subagents are coming, because the isolation guarantee you built is over context, not files, and that only holds cleanly in the sequential case.
