A scheduling agent updates a booking, performs read-only work while waiting for an external response, and then updates the booking again. Permission scope is already restricted to that booking. The workflow can grant and revoke booking-update permission around individual tool invocations. Both updates must complete autonomously, and booking-update permission must be absent between the two invocations.
Which permission lifecycle should the workflow implement?
Grant and revoke booking-update permission separately for each update. This supports both autonomous operations without retaining update privileges during the intervening read-only work.
- Not correct: Grant permission before the first update; revoke it after the second update. This retains permission throughout the intervening work. The source recommends removing privileges after each use.
- Correct: Grant permission before each update; revoke it immediately after that update. Each update receives its required permission, and the permission is removed between uses. This follows both parts of the source's short-lived privilege guidance.
- Not correct: Grant permission before the first update; revoke it immediately after that update. This provides no grant for the second update. The source recommends granting privileges when needed as well as removing them after use.
- Not correct: Grant permission before each update; revoke it when the entire workflow finishes. Granting permission again does not remove the first grant during the interval. Workflow-level cleanup does not implement the source's removal after each use.
- Defend against indirect prompt injection attacksMicrosoft Learn