Goals and Loops: How to Give an AI Agent a Job Without Losing Control

Key Takeaways

  • A goal tells an agent what outcome it is working toward.

  • A loop is the repeated set of steps the agent uses to make progress, check its work, and decide what happens next.

  • A useful loop has a clear starting point, quality checks, approval points, and a stopping rule.

  • An agent should stop when a pass is complete, when it reaches a limit you set—for example, after three failed attempts—or when human judgment is required.

  • You can describe goals and loops in ordinary language. You do not need to speak like a programmer.

This is the third post in this series. In the first post, I described AI agents as AI with arms. In the second post, I focused on limiting what those arms can reach and do.

This post addresses the next question: Once an agent has a job, how does it know what it is trying to accomplish and what to do next?

This is where goals and loops come in.

Think of the agent as an intern. The goal is the result you want the intern to produce. The loop is the repeated set of steps the intern follows: check what needs attention, take the permitted next step, review the result, and either continue, stop, or return to the supervisor.

A good supervisor would not tell an intern to “keep working until everything is better.” The supervisor would define the desired result, explain how the work should proceed, identify when approval is required, and make clear when the job is finished.

Goals and loops serve those same purposes for an AI agent.

A Goal Is the Result You Want

When you tell AI, “Help me organize these notes,” or “Draft an email,” you are already expressing a goal. The goal is simply the result you want. In the intern analogy, it is the result you expect the intern to bring back.

For a one-time chat, that may be enough. You ask for something, the AI responds, and you decide what happens next.

Goals become more important when the work involves several steps or happens repeatedly. An agent needs enough clarity to determine whether it is making progress and when the job is complete.

Compare these two goals:

Vague goal: Keep me updated on school psychology research.

More useful goal: After each new set of Google Scholar alerts, prepare a short digest of the articles most relevant to AI and school psychology. For each article, include the topic, a brief practice-focused summary, the study country and sample, why it may matter to my work, and links to the source and dashboard. Preserve the remaining articles in a searchable archive.

The second goal is more useful because it describes the audience, output, priorities, and limits. The intern knows what a useful result looks like, and the supervisor can tell when it is ready for review. Those details become the starting point for the six-part loop described below.

A Goal Can Be One-Time or Ongoing

The word goal may sound like a standing objective that continues for weeks or months. It can, but it does not have to.

A goal may be:

  • Immediate: Compare three public guidance documents and identify meaningful differences.

  • Project-based: Turn a set of public research articles into a draft professional-development presentation.

  • Recurring: Each weekday, review new public policy updates and prepare a short summary.

  • Conditional: When a new public grant announcement appears, extract the deadline, requirements, and likely fit with my work.

What changes is how often the intern checks in and what starts the job—not whether it counts as a goal.

A Loop Is the Repeated Set of Steps

In plain language, the intern’s loop says:

  1. Check what has changed.

  2. Decide what needs attention.

  3. Take the permitted next step.

  4. Check the result.

  5. Continue, stop, or ask a person for help.

That final step is essential. A well-designed loop has a clear condition for when a pass is complete—even loops meant to run continuously stop cleanly at the end of each iteration rather than running forever without a checkpoint.

For example, a research-triage loop might look like this:

  1. Check for new Google Scholar alert messages from the approved sender.

  2. Extract the articles and remove duplicates.

  3. Retrieve publicly available abstracts and, when permitted, full text.

  4. Classify each article as high, medium, low, or uncertain relevance.

  5. Prepare concise summaries of a small number of useful articles.

  6. Check that every summary contains the required information and source link.

  7. Update the searchable archive.

  8. Present the digest for review and stop.

If there are no new articles, the agent should record that nothing changed and stop. If a source is blocked, it should preserve the completed work, report the obstacle, and stop rather than retrying forever or looking for an inappropriate workaround.

Here is a real example from my own research system. Each day, the agent processes approved Google Scholar alert emails, removes duplicate articles, classifies the results, and records what it completed. During the month shown below, it completed 21 separate runs and screened 747 unique articles.

July 2026 Research Dashboard showing 21 runs and 747 unique items screened.

One month of daily Google Scholar alert triage, organized into dated runs.

The goal is not simply to process email. The goal is to turn a large volume of research alerts into something I can actually use. After completing the daily steps, the agent adds the results to a searchable research library.

Search and filter controls for a local research library containing 2,043 searchable articles.

The handoff: a searchable library that can be filtered by priority, subject, country, and my own feedback.

This system lives on my local computer. I am showing these screenshots as an example of how an agent can complete a recurring series of steps and prepare the results for human review. Readers cannot interact with the features shown here because the underlying files and agent remain on my machine. The system processes research alerts and public research materials; it does not contain student or clinical information.

The Six Parts of a Useful Loop

A useful loop gives the intern six pieces of information:

  • A starting point: What tells the intern to begin? It might be a schedule—for example, every weekday morning—a new file, an incoming message, a changed webpage, or a person saying, “Run this now.”

  • A check: What should the intern inspect before acting? The intern may look for new information, missing fields, duplicates, unresolved items, or a previous completed run.

  • An action: What is the intern allowed to do? The action may be limited to reading, organizing, analyzing, or drafting.

  • A quality check: How will the intern determine whether the work is usable? The intern might check required fields, compare a summary with its source, confirm that a link works, or run a defined test.

  • A stopping rule: What ends this pass? The intern may stop when the output passes its checks, when there is no new information, after a set number of failed attempts—for example, three—or when human judgment is required.

  • A handoff: What should the intern return to the supervisor? The result might be a short digest, a dashboard, a draft, a list of decisions, or one clear question requiring a response.

The handoff matters. An agent should reduce cognitive overload, not return with a pile of material that creates more work than it saves.

The Goal and the Loop Work Together

A clear goal is not enough by itself. An intern may understand the desired outcome but still need guidance about how to proceed.

Consider this goal:

Help me stay current on new research related to AI and school psychology.

The goal provides direction, but it leaves important questions unanswered. Where should the agent look? How often should it check? Which articles matter? What should it produce? How should it check its work? When should it stop?

The loop answers those questions.

The difference becomes clear when we compare two possible loops:

Poor loop: Search continuously, which wastes time and uses plan limits; download anything you can find, which creates clutter; keep retrying blocked sources, which wastes time and may get you locked out; and email every result immediately, which turns the handoff into information overload.

Better loop: Check approved sources every weekday morning, preserve the articles in a searchable archive, summarize only the most relevant items, stop when access is blocked, and prepare one digest for review.

The goal tells the intern where it is going. The loop describes how it should get there.

You Do Not Need to Speak Like a Programmer

Most school psychologists do not need to write technical specifications. Instead, think like a supervisor assigning work to a new intern. The six-part loop is the supervisor’s checklist: explain what starts the job, what the intern should check, what actions are allowed, how the intern should check quality, when the intern must stop, and what the intern should return for review.

The agent can help turn your answers into a proposed goal and set of steps. It should not create a schedule, expand its access, or add consequential actions unless you approve those changes.

You might begin with a request like this:

I have a recurring, low-risk job that takes too much time. Help me define the goal. Then propose the six parts of the loop: what starts the process, what the agent should check, what actions are allowed, how it checks quality, when it must stop, and what it should return for my review. Do not create a schedule or connect any tools until I approve the plan.

That request keeps the person involved while allowing the agent to help create the structure.

Self-Checks Help, but They Are Not Independent Review

An agent can be instructed to check its own work. For example, it may confirm that every article has a source link, country, sample description, summary, and priority label before completing a digest.

That is useful, but a self-check is not independent verification. The same system that made an error may fail to notice it.

Self-checks are more useful when paired with objective evidence:

  • Required-field checks.

  • Comparisons between sources and summaries.

  • File and link checks.

  • Duplicate detection.

  • Saved records of what the agent attempted.

  • Human review of a sample of the results.

  • Feedback about which outputs were actually useful.

The goal is not to eliminate human review. It is to make that review faster and more informative.

Start with Low-Risk Goals

There are many useful goals that do not require student information. An agent could:

  • Monitor public state guidance and professional-association updates.

  • Organize public research into a searchable resource library.

  • Turn selected public research into draft professional-development materials.

  • Maintain a calendar of public deadlines and training opportunities.

  • Create fictional consultation scenarios for graduate-student practice.

  • Compare public resources with an educator-created quality checklist.

For any demonstration, the rule should be simple: do not enter student information, clinical information, or details from a real case. Use public materials, fictional scenarios, synthetic data, or your own nonsensitive resources.

What Comes Next

In the next post(s), I will show what agentic use looks like. The story is not a perfect success narrative.

Final Takeaways

  • Start with the outcome you care about.

  • Give the agent a repeatable set of steps for moving toward that outcome.

  • Include a starting point, quality checks, approval points, a stopping rule, and a clear handoff.

  • Require approval before creating recurring schedules or granting broader authority.

  • Use self-checks to support—not replace—objective checks and professional review.

A short note: If you would be interested in a small, hands-on training where participants define and build their own privacy-conscious agent, let me know. I am gauging interest before deciding whether to develop the training.

You can also listen to the first episode of Beyond the Bot, my podcast about AI agents.

AI Disclosure: Generative AI was used to assist with drafting and editing this post and to create the accompanying image. I reviewed and revised the content and take responsibility for its accuracy and final form.

Adam Lockwood

Adam B. Lockwood, PhD, NCSP, LP, is a school psychologist, researcher, and consultant focused on the responsible use of artificial intelligence in education and psychology.

https://lockwoodconsulting.net/about
Previous
Previous

I Built a School Psychology Video Game with an AI Agent

Next
Next

Before You Hand Over the Keys: Using AI Agents Safely in School Psychology