BRK281 · Breakout

Securing coding agents and their code

  • Friday 20 November
  • 47 min
  • Catalogue level: (300) Advanced
  • Our depth rating: 300
  • Worth watching: 2/3

Speakers: Ricky Diep, Rohan Parakh

Watch on Microsoft’s site from 08:30

Microsoft’s player cannot open a video at a given time: once it plays, skip to the time shown.

What the session covers

GitHub's Ricky Diep and Rohan Parakh show how to govern coding agents and the code they produce. The first half covers guardrails: copilot/managed-settings.json, repository rulesets with CodeQL gates, CODEOWNERS, agent-scoped secrets, GitHub Copilot cloud and local (MXC) sandboxes stated as GA, package firewall and agent inventory in Agent 365 with Entra Agent ID. The second half applies GitHub Advanced Security to agent-generated code: the coding agent self-scanning its PRs, a security review command in Copilot CLI and IDEs, secret and dependency scanning tools in the GitHub MCP server, secret scanning in Copilot code review, and Agentic Autofix that validates fixes with tests and scans. Most points are backed by demos, ending with Q&A on deterministic secret scanning, scale and auto-merge limits.

Best for: Platform, DevSecOps and AppSec engineers who need to roll out GitHub Copilot coding agents at enterprise scale with enforceable guardrails and automated security gates.

Session timeline by chapter

New material starts at 08:30. Before 08:30 the session covers the intro and existing controls (managed settings, rulesets, CODEOWNERS, agent secrets); at 08:30 the GitHub Copilot cloud and local sandboxes stated as GA are introduced.

Where to skip: If you know managed settings and rulesets, start at 08:30 (sandboxes) and watch the package firewall demo at 10:24; skip the AppSec risk recap 17:26–24:37 and jump to 24:37 for the security gates, then the demos at 30:35, 36:04 and 38:17 (Agentic Autofix) are the core; the 02:28 settings walkthrough is worth it if you are setting up a baseline.

Chapters (17)

  1. 00:05 Recap Depth 100 · Novelty 0/3

    Session intro: questions to answer before rolling out coding agents at scale

    Ricky Diep (GitHub product marketing) and Rohan Parakh (GitHub Advanced Security PM) introduce the session on securing coding agents and the code they generate. Ricky lists common customer questions: what agents can read, which permissions, tokens and secrets they hold, where they execute, and whether their output is production-ready. A built-in protections slide maps risks such as agents pushing code, accessing sensitive data and prompt injection to mitigations.

  2. 02:28 Demo Depth 300 · Novelty 1/3

    Enterprise managed settings JSON, repository rulesets, CodeQL gates and CODEOWNERS

    Ricky shows the recommended baseline in copilot/managed-settings.json: disableBypassPermissionsMode set to true, deny rules for production CLIs, credential stores and force-push, ask rules that keep a human in the loop for package installs and network tools, and sandbox enabled by default. He then walks through an organization repository ruleset with active enforcement, an empty bypass list, targeting by a custom property, required pull requests before merging and required CodeQL results at high-or-higher severity. A CODEOWNERS file assigns Copilot instruction and governance files to a governance team so custom agents cannot bypass the rules.

  3. 07:12 Deep dive Depth 200 · Novelty 1/3

    Agent secrets and variables: least privilege, no production reach, org/repo scoping

    Ricky shows the repository settings page "Agents secrets and variables", where secrets and variables can be created specifically for coding agents at repository or organization level. This lets admins scope credentials per agent, revoke keys and issue new ones when needed. The accompanying slide recommends a named owner, documented purpose and rotation date for every secret, no production write access, scoping by org/repo and monitoring.

  4. 08:30 New Depth 300 · Novelty 2/3

    GitHub Copilot sandboxes: cloud on Azure Container Apps and local via MXC, both GA

    Sandboxes are isolated, ephemeral environments in which agents run and test code without touching production. The cloud sandbox, started with copilot --cloud from the Copilot CLI or the GitHub app, runs on Azure Container Apps; the local sandbox runs through Microsoft Execution Containers (MXC) and restricts tool sets and network policies on the developer machine. Ricky says both were made GA at GitHub Universe and that cloud sandboxes consume existing GitHub Actions minutes instead of requiring a new subscription.

  5. 10:24 Demo Depth 200 · Novelty 2/3

    Demo: package firewall blocks a vulnerable npm package in the local sandbox and Actions

    In a locally managed sandbox that inherits the enterprise and network policies, running npm install for ejs@2.7.4 is blocked by package firewall because the package has a known critical vulnerability. The same block appears in a GitHub Actions workflow log, which points to the newer version and offers a bypass request. Admins can approve or deny such bypass requests.

  6. 11:51 Demo Depth 200 · Novelty 1/3

    Demo: Copilot-authored PR blocked until Autofix and code review suggestions are resolved

    A pull request created by the Copilot coding agent cannot be merged: the ruleset requires approval and the user is not an admin. Copilot Autofix and Copilot code review propose fixes, applied once when the agent generates code and again at human review; agents and humans pass the same checks. The PR is labelled as authored by Copilot, giving an audit trail, and each suggestion is committed before the review is submitted for an approver to merge.

  7. 14:12 Demo Depth 200 · Novelty 1/3

    Observability and governance: Entra Agent ID, Agent 365 agent map and inventory

    Ricky covers observability for coding agents: activity view, agent risk from Microsoft Purview, Entra and Defender, and an agent map of MCP connections. Agents built in GitHub or Copilot Studio and deployed via Microsoft Foundry get an Entra agent ID, can use over 11,000 Foundry models and appear automatically in Agent 365. In the Microsoft 365 admin center he shows the Agent 365 agent map clustered by platform (52 Foundry and 722 Copilot Studio agents in the demo tenant) and the GitHub Copilot agent details with users, tools, security, permissions and activity tabs.

  8. 17:26 Recap Depth 200 · Novelty 0/3

    Why agent-generated code inherits every AppSec risk

    Rohan stresses that agent-generated code remains the customer's responsibility and carries the same risks at agentic scale: injection (now including prompt injection), vulnerable or malicious open-source dependencies, typosquatting, leaked secrets persisting in Git history, tech debt such as dead or untested code, and unauthorized agentic actors. He cites a rise in new code vulnerabilities to about 200 million in one year. His conclusion is that automated gates are needed so AppSec can keep pace with agentic development.

  9. 22:07 Recap Depth 200 · Novelty 1/3

    GitHub Advanced Security pillars applied wherever code is generated

    Rohan positions GitHub Advanced Security as an existing platform now applied regardless of who or what generates code. He covers secret protection (stopping leaks before code reaches GitHub Enterprise Cloud), code security with a focus on fixing via agentic autofix, supply chain security with license compliance and build attestations, code quality, and policy and governance through rulesets and security overview.

  10. 24:37 New Depth 300 · Novelty 2/3

    Security gates in the agentic SDLC: coding agent, /security-review, MCP tools, code review

    Rohan describes gates across the lifecycle: the Copilot coding agent checks its own changes with secret scanning, code scanning, code quality and dependency checks before opening a PR; a security review command in Copilot CLI, the Copilot app and IDEs such as VS Code reviews staged changes locally; and the GitHub MCP server exposes secret scanning and dependency scanning as tools for any coding agent. Starting this week, secret scanning can be enabled in Copilot code review, with code scanning and code quality checks coming soon and not requiring a GitHub Advanced Security license. Existing CodeQL, Dependabot and secret scanning checks continue to gate merges.

  11. 28:38 New Depth 300 · Novelty 2/3

    Proactive controls: package firewall and Agentic Autofix with test validation

    Rohan explains package firewall, launched at GitHub Universe, which keeps outright malicious packages from reaching developer machines and build systems, often the entry point of recent breaches. He then introduces Agentic Autofix as a new version of Copilot Autofix: it generates a fix PR, validates it against the repository's tests, iterates recursively to improve the fix, warns if tests would break and can offer to fix the tests.

  12. 30:35 Demo Depth 300 · Novelty 2/3

    Demo: coding agent self-scans its PR and Copilot CLI security review of staged changes

    Rohan assigns an issue "Add order search and notes endpoints" to the Copilot coding agent, then shows an earlier session log in which the agent ran secret scanning and a CodeQL scan that found a missing rate-limiting issue and fixed it. In Copilot CLI he reviews a local diff containing fake passwords and secrets and runs the security review command on staged changes, noting it also works on the whole local repo and in the Copilot app and IDEs. Secret scanning and dependency scanning in the security review command are said to be coming soon.

  13. 34:01 Demo Depth 300 · Novelty 1/3

    Demo: push protection blocks a Stripe key; security review finds SQLi and XSS

    Ignoring the review, Rohan commits and pushes; push protection rejects the push because a Stripe API key was detected, and a bypass can be requested with a justification via the provided URL. The security review results show SQL injection and reflected XSS in src/order-search.ts with confidence levels, and offer follow-up actions: …, fix everything, or commit a summary. Package firewall keeps blocking malicious packages locally, in Actions and in sandboxes.

  14. 36:04 Demo Depth 200 · Novelty 2/3

    Demo: Copilot code review flags a secret; merge box gated by CodeQL and rulesets

    In the PR created by the coding agent, Copilot code review reports quality issues and a possible hardcoded secret, which Rohan calls a new capability added this week; comments can be resolved with Copilot inline. He notes Copilot code review can perform these security assessments without a GitHub Advanced Security license. The merge box stays blocked by required reviews, a CodeQL alert and unresolved conversations, enforced by repository rulesets, and he recommends moving from branch protections to rulesets that can be enforced at enterprise or org level.

  15. 38:17 Demo Depth 300 · Novelty 2/3

    Demo: Agentic Autofix remediates reflected XSS and validates with tests and scans

    The reflected XSS pushed earlier is still caught by code scanning as an alert. Rohan assigns the alert to Copilot; the resulting session starts an autofix sub-agent that extracts the alert, reads custom Copilot instructions and README, edits files, runs regression tests and any Actions tests, then runs secret scanning and code scanning so no new vulnerabilities are introduced. The result is a pull request with high confidence that can be merged.

  16. 40:47 Closing Depth 100 · Novelty 0/3

    Recap: guardrails for agents and runtime, code integrity at agentic pace

    Rohan recaps the two halves of the session: guardrails and controls for coding agents and their runtime across the enterprise, and maintaining code integrity standards despite fast agentic development. The Next Steps slide lists resources gh.io/copilot-guardrails and gh.io/secure-copilot-docs and related sessions such as BRK283. He then opens the floor for questions.

  17. 41:54 Q&A Depth 300 · Novelty 1/3

    Q&A: how local secret scanning works, scaling to classrooms, auto-merge boundaries

    Rohan explains that secret scanning is not LLM-based but deterministic, submitting hashes to APIs and in some cases validating with providers whether a secret is active; a fine-tuned model hosted by GitHub is in the works. For an education scenario with about 1,000 students, he says security configurations and rulesets apply at enterprise or org level to repositories regardless of user, and are used by enterprises with hundreds of thousands of developers including Microsoft. On auto-merging agent PRs without human review, he says the area is still evolving, GitHub is discussing ways to grade work for auto-merge eligibility, and compliance such as SOC 2 still drives human review in large enterprises.

Announcements (12)

  • 08:37 GA GitHub Copilot

    GitHub Copilot cloud sandbox

    Runs Copilot in an isolated, GitHub-hosted environment on Azure Container Apps, started with copilot --cloud.

    Speaker’s quote (at 08:37)
    „At GitHub Universe, we GA both versions of this within the cloud.“
  • 09:04 GA GitHub Copilot

    GitHub Copilot local sandbox (MXC)

    Runs Copilot tools in an isolated local environment through Microsoft Execution Containers with limited tools and network access.

    Speaker’s quote (at 09:04)
    „Local is another one that we GA'd that runs through MXC.“
  • 09:31 not stated GitHub Copilot

    GitHub Actions minutes for Copilot cloud sandboxes

    Cloud sandboxes can be paid for with existing GitHub Actions minutes without a separate subscription.

    Uses GitHub Actions minutes

    Speaker’s quote (at 09:31)
    „for GitHub Copilot sandboxes within the cloud, you're actually able to use your action minutes to do this.“
  • 25:34 not stated GitHub Copilot

    Security review command in Copilot CLI, Copilot app and IDEs

    Evaluates staged changes or the whole local codebase for vulnerabilities and lets the agent fix them before code reaches GitHub.

    Speaker’s quote (at 25:34)
    „you can still use things like a security review command, whether you're using Copilot CLI app or Copilot on VS Code“
  • 26:07 not stated GitHub Copilot

    Secret scanning and dependency scanning tools in GitHub MCP server

    Lets any coding agent scan repositories, code content and staged or uncommitted changes for secrets and vulnerable dependencies via MCP.

    Speaker’s quote (at 26:07)
    „you have the ability to use secret scanning and dependency scanning as an MCP tool as well“
  • 27:11 not stated GitHub Copilot

    Secret scanning in Copilot code review

    Copilot code review identifies secrets that could be leaked through pull requests.

    this week

    Speaker’s quote (at 27:11)
    „as of this week, you have the ability to add security checks to your Copilot coding review as well.“
  • 27:39 not verified GitHub Copilot

    Code scanning and code quality checks in Copilot code review

    Copilot code review will run code scanning and code quality checks without needing a GitHub Advanced Security license.

    No GitHub Advanced Security license required; part of Copilot code review

    Speaker’s quote (at 27:39)
    „Very soon you should be able to do code scanning scanning and code quality checks within the Copilot coding preview agent itself.“
  • 28:38 not stated GitHub Advanced Security

    GitHub package firewall

    Blocks malicious packages from reaching developer machines, build systems and environments.

    Speaker’s quote (at 28:38)
    „So at Universe, we launched package firewall, which Ricky was demonstrating a few minutes back“

    GitHub Copilot: práce s agenty od plánování po řešení problémů v produkci

  • 29:40 not stated GitHub Advanced Security

    Agentic Autofix

    Generates a fix PR for a code scanning alert and validates it against the repository's tests through recursive attempts.

    Speaker’s quote (at 29:40)
    „Copilot Autofix was there for some time, but now we have a new version, which is the Gentic Autofix“
  • 33:35 roadmap GitHub Copilot

    Secret scanning and dependency scanning in the security review command

    The security review command will also surface secret scanning and dependency scanning findings.

    Speaker’s quote (at 33:35)
    „you will start seeing secret scanning and dependency scanning, those kind of things also kind of showing up very soon.“
  • 42:26 not stated GitHub Advanced Security

    Fine-tuned secret scanning model hosted by GitHub

    GitHub is working on a model fine-tuned for secret detection and hosted within GitHub.

    Speaker’s quote (at 42:26)
    „there's some work happening around having a fine-tuned model for that also. But that model is all hosted within GitHub by GitHub“
  • 45:26 not stated GitHub Advanced Security

    PR grading for auto-merge eligibility

    GitHub is discussing letting customers classify PRs by grade to decide which can be auto-merged.

    Speaker’s quote (at 45:26)
    „provide you an ability to grade your work in a way where you can decide like this grade of work can be auto merge“

Demos (8)

  • 02:51 Not stated GitHub Copilot

    An enterprise admin defines baseline guardrails for coding agents and humans through managed settings, rulesets and code owners.

    Steps (10)
    1. Open the copilot/managed-settings.json file in the governance repository.
    2. Set permissions.disableBypassPermissionsMode to true.
    3. Add deny rules for destructive and exfiltration-prone operations such as force-push, credential stores and production CLIs.
    4. Add ask rules for package installs, network tools and infrastructure CLIs so a human must approve them.
    5. Enable the sandbox by default in the settings.
    6. In organization settings, open Repository rulesets and edit the ruleset targeting Copilot repositories via a custom property filter (props.ai-ready:true).
    7. Set enforcement status to Active and leave the bypass list empty or add specific roles, teams or users.
    8. Under branch rules, enable Require a pull request before merging.
    9. Enable required code scanning results with CodeQL and set the alert threshold to High or higher.
    10. Add a CODEOWNERS file assigning Copilot instruction and governance files to a governance team.

    Prerequisites: GitHub organization/enterprise admin rights; CodeQL code scanning for the CodeQL gate.

  • 10:24 Not stated GitHub package firewall

    A developer working in a Copilot local sandbox tries to install a vulnerable npm package and is blocked by enterprise policy, both locally and in CI.

    Steps (5)
    1. Open a terminal running GitHub Copilot in a locally managed sandbox that inherits enterprise policies.
    2. Run ….
    3. Observe that the install is blocked by package-firewall security policies with an ETARGET error and a bypass request URL.
    4. Open the GitHub Actions run of package-firewall-demo.yml and review the failed install job.
    5. Read the summary stating that GitHub Package Firewall blocked npm:ejs@2.7.4 due to a critical vulnerability, with a link to the newer version and the Request bypass option.

    Prerequisites: Enterprise policies with package firewall and sandbox enforced by default.

  • 11:51 Not stated GitHub Copilot

    A reviewer handles a Copilot-generated pull request that is gated by rulesets and enriched with Autofix and code review suggestions.

    Steps (6)
    1. Open the pull request "Add persistent dark mode toggle" created by Copilot.
    2. Check the merge status panel showing checks passed but merging blocked pending approval.
    3. Review the Copilot code review comments and the code scanning suggestions (e.g., CodeQL workflow matrix, CSS contrast fixes).
    4. Note the "authored by Copilot" label as the audit trail.
    5. Commit each suggested change.
    6. Submit the review so an approved reviewer or admin can approve and merge into the main branch.

    Prerequisites: Repository ruleset requiring pull request approval and code scanning; Copilot coding agent and Copilot code review enabled.

  • 14:52 Not stated Agent 365

    An admin gets an organization-wide view of all deployed agents, including GitHub Copilot, and inspects their usage and permissions.

    Steps (5)
    1. Open the Microsoft 365 admin center and go to Agents > All agents.
    2. Review inventory metrics and the agent table with search and filters.
    3. Open the Agent map to see agents clustered by platform (Foundry, Copilot Studio, Bedrock, Microsoft).
    4. Return to All agents and select the GitHub Copilot agent.
    5. Review the Details, Users, Data & tools, Security, Permissions and Activity tabs.

    Prerequisites: Access to the Microsoft 365 admin center with Agent 365.

  • 30:52 Not stated GitHub Copilot

    A developer delegates an issue to the Copilot coding agent, which validates its own changes, and separately runs a local security review in Copilot CLI before pushing.

    Steps (6)
    1. Open the issue "Add order search and notes endpoints" in the NexusTrack-Web repository.
    2. Use Assign agent to issue and assign it to Copilot without adding extra context.
    3. Open the Copilot session of a previously generated PR and review the log showing secret scanning and a CodeQL scan.
    4. Note the CodeQL finding about missing rate limiting, which the agent then addresses.
    5. In a terminal, open Copilot CLI and review the diff of staged changes (order search page, server, database config).
    6. Run the security review command on the staged changes, optionally with extra context.

    Prerequisites: Copilot coding agent enabled on the repository; Copilot CLI. Rohan notes the security review command works even if you are not a GitHub Advanced Security customer.

  • 34:01 Not stated GitHub Advanced Security

    A developer pushes code containing a secret despite warnings and sees push protection block it, then acts on local security review findings.

    Steps (5)
    1. Commit the staged changes with the message "Add order search" and push the branch to origin.
    2. Observe the push rejected by push protection due to a Stripe API key in a TypeScript config file.
    3. Open the provided URL to view the push protection page and, if justified (e.g., test system), request a bypass.
    4. Return to Copilot CLI and review the security review results (SQL injection and reflected XSS in src/order-search.ts).
    5. Choose a follow-up action such as … and select which ranked issues to fix.

    Prerequisites: Secret scanning push protection enabled on the repository; Copilot CLI.

  • 36:04 Not stated GitHub Copilot

    A reviewer uses Copilot code review to catch a hardcoded secret in a PR and sees the merge blocked by rulesets.

    Steps (5)
    1. Open the pull request "Add order search and notes endpoints" with Copilot as reviewer.
    2. Read the Copilot code review comments, including the possible secret in the database password line of server.ts.
    3. Go to Files changed and resolve comments by fixing them with Copilot inline.
    4. Check the merge box showing merging blocked by required review, an unresolved conversation and a CodeQL alert.
    5. Open repository Settings > Rulesets to see the enforcing ruleset ("BRK281 - make the gates mandatory").

    Prerequisites: Copilot code review enabled; secret scanning in code review enabled; repository ruleset with required reviews and CodeQL.

  • 38:17 Not stated GitHub Advanced Security

    An AppSec engineer delegates remediation of a code scanning alert to Copilot and receives a validated fix PR.

    Steps (5)
    1. Open Security > Code scanning and select the alert "Reflected cross-site scripting #5".
    2. Click Assign to Copilot to start Agentic Autofix.
    3. Open the resulting Copilot session ("Addressing code scanning alerts and false positives").
    4. Follow the log: autofix sub-agent, reading custom instructions/README, file edits, regression tests, secret scanning and code scanning.
    5. Open the generated pull request and review it for merge.

    Prerequisites: Code scanning enabled on the repository; Copilot coding agent; tests present in the repository (optionally run via Actions).

Related articles on ai-news.cz (in Czech)

Watch on Microsoft’s site: BRK281