---
title: "Comment by Osama Malik on \"Designing Least-Privilege Access for AI Agents\" | Hashnode"
description: "Granted-vs-used is a good way to make least privilege measurable. Two additions from agent security work: first, scope the credentials per run and make them sho"
url: "https://hashnode.com/posts/designing-least-privilege-access-for-ai-agents/6b0e85ee4dad96ec17af1c22/comment/6b0ec7b5e5022545d54a9605"
---

[Discussion](https://hashnode.com/posts/designing-least-privilege-access-for-ai-agents/6b0e85ee4dad96ec17af1c22)

Comment [Designing Least-Privilege Access for AI Agents](https://hashnode.com/posts/designing-least-privilege-access-for-ai-agents/6b0e85ee4dad96ec17af1c22)

[Osama Malik](https://hashnode.com/@osamamalik)

[10h ago](https://hashnode.com/posts/designing-least-privilege-access-for-ai-agents/6b0e85ee4dad96ec17af1c22/comment/6b0ec7b5e5022545d54a9605)

Granted-vs-used is a good way to make least privilege measurable. Two additions from agent security work: first, scope the credentials per run and make them short-lived, so a prompt-injected agent cannot reuse them outside the task. Second, derive the allowlist from traces that include adversarial inputs, such as a poisoned tool result or document, not only happy-path runs. Otherwise the policy is tight for normal behavior but says nothing about what an injected instruction could make the agent call. Logging the tool arguments, not just the tool names, helps here, because 'repo:read' on one repo is a very different grant from 'repo:read' on the whole organization.
