-
Notifications
You must be signed in to change notification settings - Fork 195
docs(designs): Add agent guidelines #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| # Agents in the Workplace | ||
|
|
||
| ## Introduction | ||
|
|
||
| Software development is changing. AI agents are no longer just tools we build—they're becoming collaborators in how we build. They review our code, respond to issues, draft documentation, and increasingly, write code alongside us. This shift isn't hypothetical; it's happening now, and we're part of it. | ||
|
|
||
| At Strands, we've been experimenting with agents across our development workflow. We've built GitHub Actions that trigger agent reviews on pull requests. We have agents that help triage issues, draft release notes, and assist with documentation. We've even started running autonomous agents on schedules—agents that identify improvements and submit PRs without explicit human prompting. | ||
|
|
||
| Some of these experiments have worked beautifully. Others have failed spectacularly (more on that later). Both outcomes are valuable. The failures teach us where the guardrails need to be, and the successes show us what's possible when agents are thoughtfully integrated into development workflows. | ||
|
|
||
| This document captures what we've learned and establishes the principles we follow when building agents that interact with our repositories. | ||
|
|
||
| ## Why This Matters | ||
|
|
||
| As the team behind an AI agent SDK, we have a unique responsibility. We're not just building tools for others to create agents—we should be using those tools ourselves. If we're asking developers to trust Strands for their agent development, we need to demonstrate that trust in our own workflows. | ||
|
|
||
| There's also a practical benefit: dogfooding. Every agent we build on Strands teaches us something about the SDK's strengths and limitations. When an agent struggles with a task, that's signal about where the framework needs improvement. When an agent succeeds, that's a pattern we can share with the community. | ||
|
|
||
| Beyond our own learning, this is simply where software development is heading. The teams that figure out how to effectively collaborate with AI agents will have a significant advantage. We want to be at the forefront of that experimentation—not following others, but leading with our own discoveries. | ||
|
|
||
| That said, experimentation without guardrails is reckless. We've learned this firsthand. An early version of [Strands Coder](https://github.com/cagataycali/strands-coder)—an autonomous agent designed to improve codebases—once started commenting on repositories it wasn't supposed to touch. No damage was done, but it was a clear reminder: agents need boundaries, and those boundaries need to be explicit. | ||
|
|
||
| This document exists because innovation and safety aren't opposites. They're partners. The goal is to enable bold experimentation while ensuring we can always recover from mistakes. | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the intro here and all the context, but I wonder if we can compact it a bit. |
||
|
|
||
| ## Guidelines | ||
|
|
||
| The following guidelines govern how we develop and deploy agents that interact with Strands repositories. Each guideline includes the reasoning behind it and, where applicable, concrete examples of what good and bad look like. | ||
|
|
||
| ### General | ||
|
|
||
|
|
||
| ### Add Value or Stay Silent | ||
|
|
||
| **If an agent doesn't have something concrete to contribute, it should stay silent.** | ||
|
|
||
| The goal isn't to have agents participate everywhere—it's to have them participate where they're helpful. An agent comment that restates what's already obvious adds nothing. An agent review that approves without substance is noise. An agent that indiscriminately picks up work creates more problems than it solves. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What does 'substance' mean here? We want the agent to provide a rational as to why it approved?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's reasoning essentially. Agent should have a reason to approve. It shouldn't just approve everything. If our reviewer agents approve all the PRs (even the bad ones), then is it really useful?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There may be value in an agent approving without a "lecture" on why it approved. A silent approval can be beneficial to reduce noise. This would especially be true if the agent is scoring well on the evals (the agent is never the final approver)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed with @afarntrog, and relates to my comment below. Maintainers rarely give " a reason to approve" and I would want our agents to perform similarly unless they want some follow up task done
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a missing piece around trust here? E.g. until I trust an agent I want the reason for approving (but also I want to know what it decided not to approve). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand the point of this guideline and also the desire to clarify what we mean by substance/value here. I wonder if it would help to clarify with a good/bad example to show the contrast?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If the output is directed somewhere else (private cloned repo and the like) this can potentially be very helpful.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, but then they are not interacting with our repositories. People can do whatever they want in their own repos :p |
||
|
|
||
| Before an agent acts, it should have something worth doing: | ||
| - A reproducible test case for a bug report | ||
| - An actionable suggestion in a code review | ||
| - A clarifying question that moves the discussion forward | ||
| - A well-defined issue that's ready for implementation | ||
|
|
||
| When in doubt, the agent should flag for human review rather than act independently. Silence is better than noise. It's better to miss an opportunity than to take the wrong action. | ||
|
|
||
| ### Security | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doc nit: These two sections are at the same level (H3)s
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually that seems to be throughout the doc |
||
|
|
||
|
|
||
| ### Scope Credentials to the Task | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AKA: Principle of least privilege
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is very much targeting a use case of Credentials - but there's a larger issue of guardrails. I think in every agent we build we need to be considering what failure looks like and how to better protect against it. That doesn't mean we have to limit an agent to do nothing, but we have to be taking explicit steps to address them. For instance, even if we're scoping credentials down, we should be asking ourselves "How can we prevent the agent from spamming every issue in the repository"; "how do we prevent pushing to any branch, etc. How we secure the agent is step 0, but also how we prevent runaways needs to be considered (even if the answer is just system prompts). we need to know the tradeoffs
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. todo: security isn't just token, we should think about other vectors before releasing it |
||
|
|
||
| **The tokens you give an agent determine what it can do. Plan for the worst case.** | ||
|
|
||
| When an agent has credentials, it has capabilities. If those credentials allow destructive actions—deleting branches, force-pushing, modifying repository settings—then a misbehaving agent can cause real damage. The principle is simple: give agents the minimum permissions they need, nothing more. | ||
|
|
||
| For task-specific agents (code review, documentation generation, issue triage), use tokens scoped to exactly those capabilities. A code review agent doesn't need write access to the repository; it needs read access to code and write access to comments. | ||
|
|
||
| For general-purpose agents where scoping is difficult, use credentials from an external account (like `strands-agent`) rather than maintainer accounts. External accounts have the same permissions as any community member—they can comment and open PRs, but they can't merge, delete, or modify protected resources. The worst case becomes "excessive commenting" rather than "repository corruption." | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get why this was included, because we did this, but its never meant as a permanent solution - just for testing. I dont think it really add too much, so I would remove it. What do you think?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather keep this, because maintainer tokens is a big risk, and honestly even I make the mistake sometimes with my local autonomous agents 😅 |
||
|
|
||
| **Never give agents maintainer tokens.** Maintainer tokens allow destructive actions that may be difficult or impossible to reverse. No experiment is worth that risk. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, this feels a bit like stating the obvious. I dont think we should be re-stating how to securely build an agent here, but more talk about helpful ways to have it engage with our github community
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's better to state the obvious. Especially with what is happening with the autonomous agents in the news recently. Agents are a powerful tool, but we need to be reminded that they need to be used responsibly. |
||
|
|
||
|
|
||
| ### Communication | ||
|
|
||
|
|
||
| ### Keep It Short | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's worth mentioning that users can use the strands-agents/evals to evaluate something like this.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good callout - I think there's a missing piece here about evaluation in general. Is there a guideline for how we evaluate/iterate on agents? |
||
|
|
||
| **Walls of text help no one. Say what matters, then stop.** | ||
|
|
||
| Agents are verbose by default. Left unchecked, they'll produce paragraphs where a sentence would suffice. This creates noise that drowns out signal—both for maintainers trying to review and for community members trying to follow discussions. | ||
|
|
||
| Agent comments should be concise. Get to the point. If there's additional context that might be useful, use progressive disclosure—put it in a collapsible section that readers can expand if they want it. | ||
|
|
||
| ```html | ||
| Here's the key finding: the null check on line 42 can throw if `config` is undefined. | ||
|
|
||
| <details> | ||
| <summary>Full analysis (click to expand)</summary> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would go even further. An ideal agent, in my opinion, leaves comments which are indistinguishable from that of a human. For me that is the gold standard we should be striving for.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it tho? I'd rather be able to distinguish the two (at least for now, I guess). imo with indistinguishable responses, it gets a bit too close to uncanny valley. https://en.wikipedia.org/wiki/Uncanny_valley
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that applies to code reviews
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the agents are too sycophantic. On a typical PR you may receive some positive feedback on occasion. Agents do this regularly. An ideal PR review from a senior for me is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
that's a fair callout. I tend to remove the "nice" stuff from my agentic reviews to not have too much noise. but we should definitely have positive feedback
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm saying the opposite actually, I think the agent gives too much positive feedback |
||
|
|
||
| [Detailed agent analysis here] | ||
|
|
||
| </details> | ||
| ``` | ||
|
|
||
| This pattern respects readers' time while still making detailed information available. | ||
|
|
||
| **Good example:** [strands-agents/sdk-python#1581](https://github.com/strands-agents/sdk-python/pull/1581#issuecomment-3844346601) — Human summary up front, detailed agent analysis in expandable sections. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know I'm nit picking, but I disagree with this being a good example:
Which are the good recommendations? which ones are critical? Effectively to find out I need to read. That's what I'd want in a summery. |
||
|
|
||
| **Bad example:** [apache/hadoop#8136](https://github.com/apache/hadoop/pull/8136#issuecomment-3657313759) — Massive automated report with no summary, no progressive disclosure, difficult to parse. | ||
|
|
||
|
|
||
| ### Autonomous Agents | ||
|
|
||
| The following guidelines apply specifically to autonomous agents—those that act without explicit human triggering. | ||
|
|
||
|
|
||
| ### Throttle Activity | ||
|
|
||
| **Don't flood the repository. Maintainers need to keep up.** | ||
|
|
||
| Even when an agent is doing good work, too much activity becomes overwhelming. If an agent opens ten PRs in an hour, maintainers can't review them thoughtfully. If it comments on every issue in a day, the notification noise becomes unbearable. | ||
|
|
||
| **Default limit: 5 actions per hour per agent** (PRs opened, reviews posted, comments made, etc.). This can be adjusted with team agreement for specific use cases, but the default should be conservative. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems arbitrary, and is probably because we dont know how to use autonomous agents correctly yet. I might just say that in this section: "While we like the idea of autonomous agents, and want to figure out helpful ways to utilize them, we have yet determined a robust framework for utilizing them. While we figure that out, please be vocal, kind, and patent with our experimentation" or something like that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with the call on this; setting a limit is a good thing, I just think these limits are too high even for humans. 5 per hour, 24 hours a day, 7 days a week means humans can't work alongside agents. I think having it execute only when we work is more reasonable. So M-F 9-5 so that it is acting more like humans and we can partner with it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 I will update here. I am not sure if we want less interactions (I think there should be limit on throttling), or just hours tho. I'll bring it up for discussion within the meeting
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: add a section for limiting active items (PRs, isuses(?), etc) |
||
|
|
||
| The goal is sustainable pace. Agents should work at a speed that humans can follow and respond to. Remember: our repositories exist for humans to collaborate. Agents are there to help, not to dominate. The community should feel like they're interacting with a project maintained by people, with agents as helpful assistants—not the other way around. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, agreed, we need to work at the same pace for it to be effective. If an agent is working at 50 times the pace we are, then we aren't able to collaborate effectively. |
||
|
|
||
|
|
||
| ### Monitor What Agents Do | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think maybe a better way to frame this is "Treat agents like any other contributor" We should be able to see contributions from an agent, track pr's they are creating, and anything else. We dont build system specifc for agents, we utilize existing features to better scale out our agent experiments.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I disagree with this. Given that we own autonomous agent, we should effectively have an audit log. I don't need an audit log for any random contributor, but I def. need one for an agent |
||
|
|
||
| **You can't fix what you can't see.** | ||
|
|
||
| Every agent that interacts with our repositories should have visibility into its actions. What did it do? When? On which repositories? How often? | ||
|
|
||
| This isn't about distrust—it's about operational awareness. When something goes wrong (and eventually something will), we need to be able to quickly understand what happened and why. When things go right, we want to learn from those patterns too. | ||
|
|
||
| Monitoring should capture: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are planning on integrating this into our internal dashboard, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how integrated we want it to be, maybe we can have just links? But yeah we should have a central place for these stuff. |
||
| - Actions taken (comments, PRs, reviews) | ||
| - Repositories affected | ||
| - Frequency and timing | ||
| - Success/failure outcomes | ||
|
|
||
| The specifics of implementation will vary, but the principle is non-negotiable: if an agent acts, we should be able to see that it acted. | ||
|
|
||
|
|
||
| ### Own What You Deploy | ||
|
|
||
| **Every agent needs an owner. If there are problems, someone fixes them or shuts them down.** | ||
|
|
||
| Autonomous agents can't be orphans. When an agent misbehaves—posting incorrect information, spamming repositories, or just not working as intended—someone needs to be responsible for addressing it. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Regarding my previous comment, we still dont know how to use autonomous agents well yet, so when we do use them, it will be as an experiment, and we need tight monitoring around that. |
||
|
|
||
| Before deploying an autonomous agent: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing from here is evals. How do we know something is ready to be deployed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I consider evals to be a bit more application/agent specific. I don't think we can give a general guidance aside from don't put trash here, do evals before coming. Even then, I'm not sure if it'll help, if it can be enforced. I'd much rather focus on how the agent is interacting with the repo, rather than how they are developed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are building an application here though. I mean we are releasing a product/tool so even if we aren't going through a formal eval pipeline, we should have some stance on when it is acceptable to put something in the wild quality-wise |
||
| - Identify the owner (a person, not a team) | ||
| - Ensure the owner can access logs and controls | ||
| - Document how to disable the agent if needed | ||
|
|
||
| If the owner leaves or becomes unavailable, ownership must transfer. An agent without an owner gets disabled until someone claims it. | ||
|
|
||
| Ownership also means cleanup. Agents will make mistakes—they'll post comments that don't make sense, open PRs that shouldn't exist, or take actions that need to be reversed. When this happens, the owner is responsible for cleaning up. Delete the errant comments. Close the bad PRs. Revert the changes. The repository should look like the mistake never happened. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ownership to "clean up", but also ownership to "make improvements" - just launching it isn't enough - we need someone to improve it enough that it's useful. Similar to experimental & strands-labs, we need a criteria of evaluation/improvement
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. todo: update |
||
|
|
||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: Autonmated/autonomous, we want some fort of initial buy in from team, doesn't have to be too expensive, but. .. |
||
| ### Maintainers Can Pull the Cord | ||
|
|
||
| **If all else fails, maintainers can shut it down.** | ||
|
|
||
| No matter how well-designed an agent is, there needs to be an escape hatch. Repository maintainers must have the ability to disable any agent operating on their repository, immediately and without negotiation. | ||
|
|
||
| This is the Andon cord principle: anyone who sees a problem can stop the line. For agents, this means: | ||
mkmeral marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - Maintainers know how to disable each agent | ||
| - Disabling is fast (minutes, not hours) | ||
| - No approval process is required in emergencies | ||
|
|
||
| This authority exists even if the maintainer isn't the agent's owner. Repository health takes precedence over agent operation. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: add refs/examples from other products, projects, and so on. see how they do it |
||
|
|
||
| ## Next Steps | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this doc is too long as a high-level guideline. What is the purpose? we need this in our repo or we really want to recommand users to follow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I wonder if we can compact all this content a bit. I think there's a lot of good stuff here. Making it more terse will increase the likelihood that folks read it from end to end and get the value. |
||
|
|
||
| Once we align on these guidelines, we'll add a condensed version to `team/AGENT_GUIDELINES.md` in the docs repo, following the same format as `DECISIONS.md`. That will be the living reference document; this doc provides the full context and rationale behind each guideline. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it sounds like we are forced to change, can we make it more positive, we are embracing change to thrive as a forwad-thiking SDK builder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean it like that, I can update the wording a bit 😅