Copilot run_agent runs the creator's latest graph version instead of the user's installed version
What happens
When the copilot runs a library agent with run_agent, it starts the graph's active (latest) version, not the version in the user's library. If that newer version isn't accessible to the user (for example, a marketplace agent whose creator published a newer version), the run fails with "You do not have access to graph #… vN" even though the library shows an older version.
Impact In one week of prod traces, an automated marketplace audit hit this on 10 of 27 workflows.
Likely cause
backend/copilot/tools/run_agent.py calls execution_utils.add_graph_execution(graph_id=library_agent.graph_id, …) without graph_version. add_graph_execution therefore resolves the active version, and validate_graph_execution_permissions then denies a non-owner that version. Master has the same code.
Fix
- Run the version the library agent points at, respecting any "use latest version" setting.
- Make sure the version validated before execution is the one that runs.
- Add a test: a non-owner whose library copy is older than the active version can run it.
Found by the weekly copilot trace review. Filed by Claude Code for Nick.
Source: Significant-Gravitas/AutoGPT