Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Getting Started with AI for VLSI Engineers5
  • Just Enough AI: Models and Context15
  • Prompting13
  • Trust and Verification14
  • Using AI for Engineering Work17
  • Engineering Walkthroughs7
  • Practical Foundations for AI Workflows4
  • Engineering Data5
  • Retrieval-Augmented Generation6
  • Agents and Tool Use18
    • What an Agent Is
      • Prompts, Scripts, and Agents
      • The Agent Loop Step by Step
      • Agent Components
      • Agent Loop Simulator
      • When a Script Wins
    • Tool Use and Structured Output
    • Planning, Memory and Stopping
    • Multi-Agent Patterns and When Not to Use Agents
  • Agent Design8
  • MCP and Skills6
  • Multi-Agent Design6
  • Practical Capstone6
  • Tokens, Cost and Latency12
  • Agentic Workflows for Chip Teams18
  • Interview and Judgment10
  • AI Skills: Full Course Index
  • Working with AI Glossary
  • Working with AI Cheatsheet
Loading lesson

‹What an Agent Is
  1. Topics
  2. AI Skills for VLSI Engineers
  3. Agents and Tool Use
  4. What an Agent Is
  5. When a Script Wins

Tools, Workflows and Agents · Beginner to Intermediate

When a Script Wins

Fixed steps, cost arithmetic, and when to skip the loop.

On this page

    Tasks with fixed steps

    Some tasks always take the same steps in the same order. Lint, format, compile, and report needs no run-time choice.

    A script also wins when a wrong extra step is costly. A loop that may run anything must be fenced; a script cannot stray.

    Signal

    Favor a script

    Favor an agent

    Step order

    Known ahead of time.

    Depends on what each tool returns.

    Tool set

    Small and fixed.

    Chosen per step from many tools.

    Inputs

    Uniform shape every run.

    Wide variety that resists branching.

    Cost of a stray step

    High, for example a write to hardware state.

    Low, for example extra read-only checks.

    Cost and reliability arithmetic

    Numbers below are stated example parameters. Real costs vary by model and setup: measure them.

    plaintext
    1
    2
    3
    4
    5
    6
    7
    assume one model decision costs 10 units and one tool call costs 1 unit
    fixed script: 0 decisions + 3 tool calls = 0 x 10 + 3 x 1 = 3 units
    agent run with 3 decisions + 3 tool calls = 3 x 10 + 3 x 1 = 33 units
    ratio: 33 / 3 = 11, so the agent run costs eleven times the script run
    assume each step succeeds with probability 0.9, steps independent
    4-step agent run: 0.9^4 = 0.6561, about 66 in 100 runs succeed
    2-step script: 0.9^2 = 0.81, so about 81 in 100 runs are expected to succeed (the expected rate under independence; actual counts vary)

    A rule of thumb

    Use a script when the path is known and an agent when only the goal is known. Start with the script and promote the step that first needs a choice.

    Least privilege still applies. An agent with write or shell tools needs human approval for risky actions, secrets never go into prompts, and proprietary IP goes only to deployments approved for its data class.

    Common mistakes

    Common pitfall

    Wrapping a solved script in an agent for flexibility. The loop adds decisions, cost, and failure points without changing the steps.

    Interview

    Likely probes: when the candidate would refuse the loop.

    • Fixed order, fixed tools, uniform inputs: ship the script.

    • Each added decision multiplies cost and failure chances.

    • Risky tools need approval gates no matter which approach wins.

    Check yourself A nightly job runs the same four checks in order and has passed for months. Script or agent?

    Script. The steps are fixed, so a loop would only add cost and new ways to fail.

    Check yourself In the worked example, how many times costlier is the 3-decision agent run than the script?

    Eleven times: 33 units against 3 units.

    Related topics

    • Agent loop simulator

    • Guardrails

    Previous

    91 / 173

    Next: Tool Use and Structured Output

    Up next

    Up nextTool Use and Structured Output

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Prompts, Scripts, and Agents
    • The Agent Loop Step by Step
    • Agent Components