Skip to main content
Autonomous Agent Build powerful autonomous agents that can read, write, and execute code in your workspace. The AutonomousAgent class extends the base Agent with built-in filesystem and shell tools, automatic storage setup, and workspace sandboxing. It’s the ideal choice for coding assistants, DevOps automation, and any task requiring file or terminal access.

Overview

AutonomousAgent inherits from Agent and comes pre-configured with:
  • Default InMemoryStorage: Automatic session storage without any configuration
  • Full Session Memory Enabled: Conversation history is preserved by default
  • Filesystem Toolkit for file operations (read, write, edit, search, etc.)
  • Shell Toolkit for terminal command execution
  • Workspace Sandboxing for security

Key Features

  • Zero Configuration: Works out of the box with sensible defaults
  • Built-in System Prompt: Automatically configured with tool usage guidelines
  • Filesystem Tools: Read, write, edit, search, list, move, copy, delete files
  • Shell Commands: Execute terminal commands with timeout and output capture
  • Workspace Security: All operations sandboxed to the workspace directory
  • Read-Before-Edit: Enforces reading files before editing for safety
  • Inherits All Agent Features: Memory, policies, streaming, caching, and more

Quick Example

from upsonic import AutonomousAgent, Task

# Create an autonomous agent with workspace
agent = AutonomousAgent(
    model="openai/gpt-4o",
    workspace="/path/to/project"
)

# The agent can read, write, and execute in the workspace
task = Task("Read the main.py file and explain what it does")
agent.print_do(task)
All file and shell operations are restricted to the workspace directory. Attempting to access files outside the workspace will be blocked for security.