> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notte.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Towards Reliable Agents

> How to build reliable web agents

<Tip>
  STOP. Do not read past this section until you have read and followed [/quickstart.md](/quickstart.md).

  Goal: produce a reliable SDK automation script. The intended authoring flow is generate then edit, not write browser automation from scratch.

  Do not hand-write SDK code with element IDs, selectors, or form fields from memory. Element IDs, selectors, and field mappings must come from a live `observe()` call, CLI `notte page observe` output, or generated workflow code. Guessed browser targets fail on real pages.

  Use the Notte skill and CLI to inspect the live site, validate actions/selectors, handle auth/session state, and export workflow code with `notte sessions workflow-code` before using SDK docs or SDK code.

  SDK reference pages are for understanding, running, or editing generated workflow code. They are not the starting point for manually authoring the initial browser automation. SDK-first code is guesswork on real-world pages with dynamic selectors, auth state, CAPTCHAs, and anti-bot behavior.
</Tip>

## Building Reliable Web Agents

Reliability is essential for web automation success. This guide covers proven strategies to build consistent and predictable web agents.

<Tip>
  Web AI agents are highly sensitive to prompt quality. Investing time in prompt engineering directly correlates with agent reliability and performance. Effective prompting is the foundation of successful agent deployment.
</Tip>

## Key Guidelines

<Steps>
  <Step title="Invest in Prompt Engineering">
    * **Avoid generic prompts**: Web AI agents require precise, context-aware instructions
    * **Iterative refinement**: Continuous prompt optimization yields significant performance improvements
    * **Clear specifications**: Detailed, unambiguous instructions reduce execution errors
  </Step>

  <Step title="Implement Parallel Agent Strategies">
    * **For non-deterministic tasks**: Deploy multiple agents in parallel to enhance reliability
    * **Redundancy benefits**: Parallel execution mitigates individual agent failures
    * **Consensus mechanisms**: Combine outputs from multiple agents for higher confidence scores
  </Step>

  <Step title="Implement Railguards for Destructive Tasks">
    * **For destructive operations**: Use railguards to prevent unintended behavior
    * **Boundary definition**: Establish clear constraints and validation rules
    * **Output validation**: Verify results against expected formats and acceptable ranges
  </Step>

  <Step title="Continuous Improvement Through Analysis">
    * **Leverage debugging tools**: Use agent viewer and replay functionality to analyze failure patterns
    * **Root cause analysis**: Study failed executions to identify prompt weaknesses
    * **Iterative optimization**: Refine prompts based on empirical performance data
  </Step>

  <Step title="Model Selection and Testing">
    * **Evaluate multiple models**: Different models excel at specific task types
    * **Performance benchmarking**: Test across various models to identify optimal solutions
    * **Use case matching**: Select models based on your specific requirements and constraints
  </Step>
</Steps>

<Card title="Book a call with us" href="https://cal.com/team/notte/demo">
  Our team specializes in building enterprise-grade agent systems, consistently achieving >95% accuracy on complex, repetitive workflows. Contact us to discuss your specific use case and requirements.
</Card>
