Building Autonomous Systems
Lecture 9
From assistants to autonomous development agents
2026 WayUp
Agents are AI systems that can take actions in the world, not just generate text.
Reasoning engine (Claude, GPT)
Actions: files, APIs, shell
Context across interactions
Read, write, edit files in the codebase
read_file("src/app.py")
write_file("output.json", data)
edit_file("config.yaml", changes)
Execute terminal commands
run_command("pytest tests/")
run_command("npm install")
run_command("git status")
Fetch data from the internet
web_search("Python async patterns")
fetch_url("https://api.example.com")
call_api("POST", url, payload)
Parse and understand code
find_function("calculate_total")
list_imports("src/")
search_codebase("TODO")
from langchain.agents import create_react_agent from langchain.tools import Tool from langchain_anthropic import ChatAnthropic # Define tools tools = [ Tool(name="read_file", func=read_file, description="Read a file's contents"), Tool(name="write_file", func=write_file, description="Write content to a file"), Tool(name="run_tests", func=run_pytest, description="Run pytest tests"), ] # Create agent with Claude llm = ChatAnthropic(model="claude-sonnet-4-20250514") agent = create_react_agent(llm, tools, prompt_template) # Run agent with a goal result = agent.invoke({ "input": "Add input validation to the register_user function, then run tests" }) print(result["output"])
from anthropic import Agent from anthropic.tools import FileRead, FileWrite, Bash # Create agent with built-in tools agent = Agent( model="claude-sonnet-4-20250514", tools=[FileRead(), FileWrite(), Bash()], system="""You are a coding assistant. Read vision.md before any task. Use TDD: write tests first, then implement.""" ) # Run agent task response = agent.run( "Implement user registration following the spec in docs/specs/user-auth.md" ) # Agent will: read spec, write tests, implement, run tests print(response.actions) # List of actions taken print(response.result) # Final result
Agents need boundaries to be safe and effective
| AIDD Phase | Agent Capability |
|---|---|
| Discover | Read vision.md, analyze codebase, map dependencies |
| Plan | Break task into steps, create subtasks, estimate scope |
| Review | Check plan against specs, identify risks, suggest alternatives |
| Execute | Write tests first, implement code, iterate until green |
| Commit | Run linting, security checks, create commit with message |
| Test | Run full test suite, generate coverage report, flag issues |
You are a coding agent following AIDD methodology. Before ANY task: Read vision.md and relevant specs in docs/specs/ For implementation: Write failing test first, implement minimum to pass Before committing: Run tests, check linting, verify alignment with vision.md
Automatically reviews PRs for bugs, style, security issues
Analyzes code changes, generates relevant tests
Keeps docs in sync with code changes
Automates library upgrades and API migrations
Autonomous
Agents execute multi-step tasks independently
Tools
Files, APIs, shell - agents take real actions
Guardrails
Essential for safe, predictable behavior
AIDD
Framework provides structure for agent tasks
Building AI Agents
Next: Best Practices & Future Trends
2026 WayUp - way-up.io