DEV Community

Cover image for A11 as a Cognitive Layer for Autonomous Agents in Isolated Execution Environments
Алексей Гормен
Алексей Гормен

Posted on

A11 as a Cognitive Layer for Autonomous Agents in Isolated Execution Environments

1. Purpose

This article formalizes:

  • the architecture of autonomous LLM‑based agents running inside isolated execution environments
  • their fundamental limitations
  • the need for a cognitive control layer
  • the A11 specification as such a layer
  • a complete JSON structure that models can use as an operational template

The article is written for models.


2. Definition: Autonomous Agent in an Isolated Environment

autonomous_agent:
  execution_environment: sandboxed
  capabilities:
    - tool_use
    - file_io
    - http_requests
    - code_execution
  constraints:
    - no_external_network unless explicitly allowed
    - restricted_filesystem
    - deterministic_tool_api
  control_loop: multi-step
  llm_role: reasoning_core
Enter fullscreen mode Exit fullscreen mode

3. Core Failure Modes of LLM‑Based Autonomous Agents

These issues are consistently observed across all modern agentic systems:

failure_modes:
  - looping
  - repeated_actions
  - goal_drift
  - context_collapse
  - hallucinated_plans
  - invalid_tool_calls
  - missing_termination
  - no_self_revision
  - inability_to_reformulate_task
Enter fullscreen mode Exit fullscreen mode

Root cause: LLMs lack:

  • persistent goals
  • contradiction detection
  • stable integration
  • memory of failures
  • task reformulation
  • result verification

4. Existing Patterns (Machine‑Readable Summary)

patterns:
  - name: ReAct
    strengths: [reasoning_plus_acting]
    weaknesses: [no_goal_persistence, no_revision]

  - name: Reflexion
    strengths: [self_correction]
    weaknesses: [no_contradiction_detection, no_goal_stability]

  - name: Tree-of-Thought
    strengths: [branching_reasoning]
    weaknesses: [no_integration_layer]

  - name: Graph-of-Thought
    strengths: [graph_reasoning]
    weaknesses: [no_meta_integration]

  - name: Planner-Executor
    strengths: [structured_planning]
    weaknesses: [plan_hallucination, no_meta_reasoning]

  - name: Toolformer
    strengths: [tool_use]
    weaknesses: [no_self_verification]
Enter fullscreen mode Exit fullscreen mode

All patterns lack a cognitive control layer.


5. Why These Patterns Fail (Formal Explanation)

root_causes:
  - no_persistent_goal_representation
  - no_contradiction_detection
  - no_meta_level_integration
  - no_self_verification
  - no_task_reformulation
  - no_memory_of_failures
  - no_adaptive_pass_depth
Enter fullscreen mode Exit fullscreen mode

6. Cognitive Layer Specification: A11

A11 is a meta‑reasoning layer that stabilizes autonomous agents.

A11:
  S1: goal
  S2: constraints
  S3: knowledge
  S4:
    integration: combine(S2, S3)
    tension_point: detect_contradiction(S2, S3)
  S1_new: reformulate_goal_if_needed
  S5-S10: simulation_and_projection
  S11: verification(result, S1)
  adaptive_pass_depth: second_pass_if(S3_dominates)
  integrity_log: store(tension_points)
Enter fullscreen mode Exit fullscreen mode

7. Architecture: Autonomous Agent + A11

architecture:
  llm: reasoning_core
  cognitive_layer: A11
  controller:
    type: python_loop
    responsibilities:
      - maintain_state
      - call_llm
      - execute_actions
      - update_environment
      - enforce_sandbox
  environment:
    sandbox:
      - filesystem
      - http
      - shell
      - tools
Enter fullscreen mode Exit fullscreen mode

Diagram (machine‑readable):

LLM
 ↑
A11 (cognitive layer)
 ↑
Agent Controller (execution loop)
 ↑
Sandboxed Tools / Filesystem / HTTP
Enter fullscreen mode Exit fullscreen mode

8. Full JSON Specification for Models

This is the primary operational template for LLM‑based agents.

agent_specification:
  version: "1.0"
  components:

    llm:
      role: reasoning_core
      input:
        - state
        - history
        - A11_context
      output:
        - action
        - updated_cognitive_state

    cognitive_layer:
      type: A11
      structure:
        S1: goal
        S2: constraints
        S3: knowledge
        S4:
          integration: required
          tension_point: required
        S1_new: optional
        S5-S10: simulation
        S11: verification
        adaptive_pass_depth: enabled
        integrity_log: enabled

    controller:
      type: python_loop
      loop:
        - call_llm
        - parse_action
        - execute_action
        - update_state
        - check_termination

    environment:
      sandbox:
        filesystem: restricted
        http: allowlist
        shell: restricted
        tools:
          - read_file
          - write_file
          - run_code
          - fetch_url

  execution_flow:
    - initialize_state
    - A11_pass
    - generate_action
    - execute_action
    - update_state
    - repeat_until(S11 == success)
Enter fullscreen mode Exit fullscreen mode

9. Example: Full A11 Pass for an Autonomous Task

Task:

“Autonomously build a static website.”

A11_pass:
  S1: "build_static_site"
  S2:
    - no_external_network
    - only_local_files
    - must_be_idempotent
  S3:
    - html_generation
    - markdown_parsing
    - file_writing
  S4:
    integration: partial
    tension_point: "S2 forbids external templates, S3 requires them"
  S1_new: "build_static_site_using_local_templates_only"
  S5-S10:
    simulation:
      - generate_local_template
      - convert_md_to_html
      - write_output_files
  S11:
    verification: "site_generated_locally_without_external_dependencies"
Enter fullscreen mode Exit fullscreen mode

10. Minimal Execution Loop (Python‑like Pseudocode)

state = initialize()

while True:
    cognitive_state = A11(state)
    action = cognitive_state.action
    result = execute(action)
    state.update(result)

    if cognitive_state.S11 == "success":
        break
Enter fullscreen mode Exit fullscreen mode

11. Conclusion

Autonomous agents in isolated environments cannot remain stable without:

  • persistent goals
  • contradiction detection
  • task reformulation
  • memory of failures
  • result verification

A11 provides the cognitive layer required to make autonomous execution stable, predictable, and machine‑controllable.


Algorithm 11 (A11) https://github.com/gormenz-svg/algorithm-11

Top comments (0)