DEV Community

Cover image for The Best Model Isn’t Enough: Harnesses, Context, and Better Prompts
Jorge Tovar
Jorge Tovar

Posted on

The Best Model Isn’t Enough: Harnesses, Context, and Better Prompts

We used to believe that a better model automatically meant better results. And that’s true to some degree, but the reality is that most people aren’t using all the available tools and techniques to get the most out of the model.

For example, context management is key. Providing good AGENTS.md and CLAUDE.md files gives agents a solid baseline from the start.

The harness is also important because the model is only one part of the system. The harness controls the context the model receives, the tools it can use, its permissions, memory, feedback loops, and how its work is evaluated.

Strands Agents lets you build a harness with tools, system prompts, plugins, specialized agents, context management, tracing, and evaluations. Claude Code is another example of a coding harness: it combines the model with repository instructions, file and terminal tools, permissions, MCP integrations, and automated workflows.

A better model can help, but a strong harness helps the model understand its environment, take the right actions, verify its work, and recover when something goes wrong.

Prompt engineering is not the main technique for getting better results. I would say that the harness is the most important thing right now—but that doesn’t mean we shouldn’t create good prompts.

Here are some useful prompt-engineering tips to help you get better results:

  • Be clear and direct: Don’t hesitate or over-explain the request. Just say what action to take, what to create, and what the key constraints are.

  • Be specific: Good instructions help you control:

    • The length of the response
    • The structure and format
    • Specific attributes or elements to include
    • Tone and style requirements
  • Use XML tags when appropriate: They’re useful when you’re including large amounts of data, mixing data with code and documentation, or need to clearly separate different parts of the context.

  • Use few-shot examples: Provide examples to guide the model. Show the exact tone and style you want, as well as how it should handle edge cases and corner cases.

Finally, if possible, create an evaluation pipeline for your prompts:

  1. Set a goal: Define what you need the model to accomplish.
  2. Write the prompt: Create your first attempt.
  3. Evaluate the prompt: Test it against your criteria using multiple scenarios.
  4. Apply prompt-engineering techniques: Use the techniques shared here.
  5. Re-evaluate: Verify that your changes actually improved the results.

Here’s a simple example.

First attempt:

What should this person eat?

- Height: {prompt_inputs["height"]}
- Weight: {prompt_inputs["weight"]}
- Goal: {prompt_inputs["goal"]}
- Dietary restrictions: {prompt_inputs["restrictions"]}
Enter fullscreen mode Exit fullscreen mode

Improved version:

Generate a one-day meal plan for an athlete that meets their dietary restrictions.

<athlete_information>
- Height: {prompt_inputs["height"]}
- Weight: {prompt_inputs["weight"]}
- Goal: {prompt_inputs["goal"]}
- Dietary restrictions: {prompt_inputs["restrictions"]}
</athlete_information>

<guidelines>
1. Include an accurate daily calorie target.
2. Show the amount of protein, fat, and carbohydrates.
3. Specify when to eat each meal.
4. Use only foods that fit the dietary restrictions.
5. List all portion sizes in grams.
6. Keep the plan budget-friendly if a budget is mentioned.
</guidelines>
Enter fullscreen mode Exit fullscreen mode

The second prompt doesn’t just ask a question. It gives the model a goal, structured context, clear constraints, and criteria that you can actually evaluate.

This is only the starting point. I’m planning to write more about harness design and context management—what they actually mean, why they matter, and how to use them to get better results from AI agents. Stay tuned.

Top comments (1)

Collapse
 
bobleer profile image
Bob Lee

The permission boundary is the underrated bit here. Better context makes the agent more capable, but permissions decide how expensive a bad guess gets. I’d take fewer tools plus an obvious escalation path over a giant toolbelt and a cleverer prompt.