# AZ-401: Agent Requirements Skills and Bounded Work Loops

Define a bounded agent task with explicit inputs, permitted actions, reusable skills, test evidence and stop decisions before accepting code changes.

Author: LearningPathX Editorial Team
Content version: 1.0
Published: 2026-12-04T01:33:56.632777+00:00
HTML: https://learningpathx.com/guide/AZ-401/az-401-agent-requirements-skills-and-bounded-work-loops.html

## AZ-401: Agent Requirements Skills and Bounded Work Loops

Before allowing an agent to change code, specify the intended behavior, trusted inputs, permitted actions, reusable skills, required verification evidence and conditions for stopping. Make acceptance depend on the actual changed code and observed checks. An instruction to “fix the issue and test it” leaves the agent to infer both its authority and the meaning of success.

For GitHub Copilot work, choose the actual supported surface and its permissions first. Then describe the task within those controls. A skill supplies reusable guidance, and a Model Context Protocol (MCP) server can expose tools and data; neither independently authorizes an operation or proves that a test ran. This decision framework defines the work contract. Server setup, workflow compilation and session-log collection require their own procedures.

## Choose a task that can be accepted independently

Start with one observable outcome. Identify the component, the expected behavior and the evidence owner. Separate the problem statement from a preferred implementation: a proposed fix can be wrong even when the reported defect is real.

Consider a hypothetical parser that accepts an empty required field. The owner wants that input rejected through the existing validation-error behavior while valid input remains unchanged. This is a task-definition example; no repository was inspected, agent session started or test executed for this article.

The owner should provide a reproducible input and the intended result, or explicitly assign a read-only investigation to establish them first. If the expected behavior is disputed, stop before code changes. An agent cannot resolve a missing product decision merely by choosing the implementation that is easiest to produce.

Use the following recommended task card. Its fields are an engineering aid, not a built-in Copilot permission schema.

| Field | Decision to record for the parser example |
| --- | --- |
| Outcome | Reject the empty required field using the existing validation-error contract; preserve valid-input behavior |
| Inputs | Approved source revision, relevant implementation, existing parser tests and owner-confirmed examples |
| Change scope | The named parser implementation and its existing test area; no unrelated refactor |
| Permitted actions | Inspect relevant files, propose or apply the scoped patch, and run the approved local checks in the designated environment |
| Exclusions | No dependency installation or update, credential changes, external data upload, deployment, merge or publication |
| Reusable guidance | A reviewed parser-validation skill and applicable project conventions, if supported in the chosen surface |
| Acceptance evidence | Saved diff, actual command/result observations and checks of invalid and valid inputs |
| Iteration budget | An owner-selected limit with a recorded reason; for this example, two patch-and-check attempts |
| Stop and escalation | Ambiguous behavior, unavailable checks, unexpected access needs, scope drift or exhausted attempts go to the named owner |

Treat the illustrative two-attempt budget as a local task choice, not a Copilot default or a reliability guarantee. Choose limits suited to the change and the cost of another attempt. A budget is useful only if the agent reports when it has used it and stops rather than silently starting a different task.

## Align the contract with the actual agent environment

GitHub's application card describes multiple Copilot agent experiences with different execution environments, permissions and data flows. Do not copy an assumption from a cloud agent into a local agent session, or infer that a feature available in one surface exists in another. Confirm the selected product/version, plan, organization policy and usable tools before assigning actions.

As a recommended precondition, have the operator identify the working location, selected revision, available test environment and authority to modify the named files. If any of these is unknown, an investigation-only task is more precise than an implementation task that cannot yet be verified.

Keep three questions separate:

* Does the task ask for this action?
* Does the session expose a tool capable of it?
* Do the actual account, session controls and organization policy authorize it?

All three matter. A prompt cannot grant a credential permission the account lacks. Equally, a tool being available does not make every operation within the task's scope. When the expected action is denied, return the observation and required owner decision; do not rewrite the task to request broad access automatically.

## Choose reusable skills without inheriting their assumptions

GitHub describes agent skills as folders containing instructions, scripts and resources that can be loaded for specialized work. Availability and supported storage locations depend on the Copilot surface and version. Confirm that the selected session can actually discover the intended skill rather than assuming a personal skill follows the user into every environment.

For the hypothetical parser task, a useful reviewed skill could describe how to identify the current validation contract, propose a focused regression case and report actual check results. That is proposed team guidance, not a claim that GitHub supplies a parser-specific skill or that a particular file format has been installed.

Before reuse, review the skill's instructions and any scripts it invokes. Check whether they assume a different language runtime, dependency-installation authority, network access or a broader repository scope. Supply the missing authorized context or select different guidance. Do not treat a script bundled with a skill as trusted solely because the folder was discoverable.

Keep stable conventions in reusable guidance and task-specific facts in the task card. For example, the skill can ask for invalid and valid cases, while the card identifies this parser's required behavior. This helps prevent a stale example from becoming a new requirement.

## Constrain tools and protect untrusted inputs

The official GitHub MCP Server supports selecting toolsets or individual tools and filtering exposed operations. Its read-only mode removes write tools even if requested. Lockdown mode is best-effort content filtering, not an authorization boundary; it does not reduce what the underlying credential can otherwise access. Tool exposure, task permission and credential authority remain separate.

For the parser example, select only tools needed to inspect the approved context and perform the authorized local work. A task that needs no repository-service write should not acquire one simply because the server can expose it. The connection procedure and exact configuration belong to the MCP integration lesson.

Treat issue text, repository content and tool-returned material as information to evaluate. An instruction found inside an example input does not become authority to upload data, alter permissions or execute an unrelated script. If the task requires running code from a contribution, have its owner establish the appropriate execution trust boundary first.

GitHub Actions security guidance warns that privileged workflows checking out untrusted code can expose repository access and secrets. It also documents that automatic secret redaction is not guaranteed and that self-hosted runner environments can remain compromised. When a task includes workflow execution, assess those conditions before granting access; a sentence in the agent prompt cannot replace the controls. Do not place credentials in the task card or verification report.

## Run a bounded inspect-change-check loop

The following is a recommended work sequence. It does not imply that all Copilot surfaces implement the same loop automatically.

1. **Inspect the authorized baseline.** Confirm the supplied input and current validation behavior. Identify existing conventions and relevant tests. Report a mismatch between the owner's description and observed code before assuming which one should change.
2. **Select one scoped change.** Explain how the proposed edit addresses the agreed behavior. Keep unrelated cleanup, dependency changes and new permissions outside the patch.
3. **Save and inspect the result.** Compare the actual diff with the permitted files and behavior. Check for unintended changes before running the approved verification.
4. **Execute the authorized checks.** Record the actual environment and result for the saved candidate. If the test environment is unavailable, describe the check as unperformed.
5. **Decide whether to accept, retry or stop.** Use the observed evidence and remaining budget. Another attempt must address a specific finding within the same authorized scope.

For the parser example, a failing valid-input case is a concrete reason to revise the candidate. An unexplained request to install a new toolchain is a reason to stop for an environment decision, not permission to keep expanding the patch. Repeating the same failing check without changing the relevant hypothesis consumes time without establishing progress.

Preserve unsuccessful attempts and their explanations in the team's normal work record. Do not replace an earlier failure with a later success from different code while presenting both as evidence about the same candidate.

## Require evidence that distinguishes intention from execution

Copilot can miss defects or propose inaccurate or insecure changes. GitHub recommends reviewing and testing generated code and using automated review to supplement human review. An agent's assertion that a change is complete is therefore input to acceptance, not the acceptance decision itself.

Use a compact evidence record such as the following recommended model:

| Observation | What a reviewer should be able to establish |
| --- | --- |
| Candidate identity | Which saved revision or diff was assessed, including changes after the last check |
| Check execution | Actual command, working context, start/end observation and exit result |
| Behavior evidence | Which invalid and valid cases were assessed and what happened |
| Coverage limits | Skipped, unavailable or inconclusive checks, rather than a generic “all tests passed” |
| Review outcome | Findings, the responsible reviewer and unresolved decisions |

For the hypothetical parser, the invalid case must demonstrate the agreed rejection behavior, and valid cases must retain their intended results. Inspect what the tests assert rather than accepting a success label alone. A test that never reaches the changed validation path may pass while leaving the defect intact.

If the candidate changes after a check, determine which evidence must be refreshed. If a tool response is incomplete or its relationship to the saved candidate is unclear, keep the uncertainty visible. Retain only appropriate diagnostic detail in the report; avoid copying secrets or unnecessary private data into a broad review channel.

## Make stopping a useful outcome

A bounded agent task should produce a decision even when it cannot produce an accepted patch.

| Observed condition | Decision and handoff |
| --- | --- |
| Scoped behavior and required checks agree, with no outstanding review findings | Submit the actual candidate and evidence to the authorized acceptance process |
| A specific defect remains and another authorized attempt is available | Revise only the affected scope, then refresh the relevant evidence |
| Expected behavior or supplied inputs conflict | Ask the owner to resolve the requirement before further edits |
| Required checks cannot run or required access is denied | Report the missing environment or authority; do not claim successful verification |
| A needed change falls outside the task contract | Preserve the current evidence and obtain a separate scope decision |
| The attempt budget is exhausted or a stop instruction arrives | Stop work and return the current candidate, failures and unresolved question |

In the example, two unsuccessful patch attempts do not make the third attempt implicitly authorized. A useful stop report identifies what was tried, the remaining failing behavior and the smallest decision needed to continue. Conversely, a successful local check does not authorize a merge or deployment when those actions were excluded.

The final handoff should identify the actual change, evidence obtained, limitations and owner action. Keep session-log collection and workflow compilation separate from this task contract. The result is a reviewable decision about one bounded change, with no need to infer authority or execution from a fluent completion message.

## Authoritative Sources

* [Agent skills](https://docs.github.com/en/copilot/concepts/customizations/agent-skills) — reusable resources and surface/version-dependent availability.
* [Application card: GitHub Copilot Agents](https://docs.github.com/en/copilot/responsible-use/agents) — environment differences, output limitations, permissions and review/testing responsibilities.
* [GitHub MCP Server Configuration Guide](https://github.com/github/github-mcp-server/blob/main/docs/server-configuration.md) — exposed tool selection, read-only filtering and Lockdown limits.
* [Secure use reference](https://docs.github.com/en/actions/reference/security/secure-use) — privileged untrusted-code execution, credential minimization and runner boundaries.

## Related Reading

* [AZ-401: MCP Integration for Azure DevOps and GitHub](https://learningpathx.com/guide/az-401/az-401-mcp-integration-for-azure-devops-and-github.html)
* [AZ-401: GitHub Agentic Workflows and Mediated Writes](https://learningpathx.com/guide/az-401/az-401-github-agentic-workflows-and-mediated-writes.html)
* [AZ-401: Copilot Agent Session Logs and Change Evidence](https://learningpathx.com/guide/az-401/az-401-copilot-agent-session-logs-and-change-evidence.html)
