Use this guide when an LLM agent, approval workflow assistant, or service
reads lfpolicy JSON output. This is runtime integration guidance, not coding
agent guidance for modifying this repository. Repository coding agents should
start with ../AGENTS.md.
Backend services should invoke lfpolicy through the CLI module and consume JSON
artifacts. See service-integration.md for the
subprocess contract boundary.
Separate technical severity from workflow action.
severitydescribes the governance signal produced bylfpolicy.recommended_actiontells the consuming workflow what to do next.hard_blockis a boolean shortcut forrecommended_action: "block".
Do not convert every severity: "error" into a user-facing block. In advisory
flows, many errors mean "policy risk found; get review or approval", not
"execution is impossible".
recommended_action |
Agent behavior | User-facing language |
|---|---|---|
inform |
Show as context only. | 참고 |
review_required |
Summarize evidence and route to a reviewer. | 검토 필요 |
approval_required |
Ask for explicit approval, exception metadata, or ticket evidence. | 승인 필요 |
block |
Stop the workflow until the policy or request changes. | 차단 사유 |
Use hard_block: true only for "cannot proceed" language. Otherwise, prefer
"검토 필요", "승인 필요", or "정책상 위험 항목 발견".
Read review/summary.json first.
- If
statusisblocked, stop. Explainblocking_reasons. - If any record has
hard_block: true, stop even if the caller did not inspectsummary.jsonfirst. - If
recommended_actionisapproval_required, request approval evidence, exception metadata, or a linked ticket before continuing. - If
recommended_actionisreview_required, summarize the plan, lint, and audit evidence for a human reviewer. - If
recommended_actionisinform, show the finding only as context. - Do not execute AWS writes from a review bundle alone.
lfpolicyhas no apply command in 0.9.0 and later; consuming services own approval and execution.
Recommended review summary handling:
{
"status": "review_required",
"recommended_action": "approval_required",
"action_summary": {
"inform": 0,
"review_required": 1,
"approval_required": 1,
"block": 0
},
"blocking_reasons": []
}The correct interpretation is: "This is not blocked, but it needs approval or reviewer action before proceeding."
For lint.json, audit.json, and plan.json, inspect each item:
{
"severity": "error",
"recommended_action": "approval_required",
"hard_block": false
}The correct interpretation is: "This is a serious governance signal, but the workflow should request approval rather than claim the request is impossible."
Examples:
- Broad principal,
SUPER, mutating grant, grant option, or named grant: usuallyapproval_required. - Safe additive grant or drift evidence: usually
review_required. IAM_ALLOWED_PRINCIPALS_PRESENT: migration-readiness evidence that requires review, but is not a hard block and must not trigger an automatic revoke.- Expired exception, duplicate identity, invalid LF-Tag reference, invalid
permission combination, or destructive planned change: usually
block.
review/explain.json is planned grant-change evidence. It answers:
- What grant changes are planned?
- Which principal/resource/permissions are involved?
- What was before and what would be after?
- Why is the grant change planned?
It does not answer arbitrary access questions. Do not use it to tell a user why someone currently can or cannot access a table.
For operational access questions, use explain-batch:
lfpolicy explain-batch \
--requests access-requests.json \
--current-snapshot current.json \
--output jsonOnly treat an access request as allowed when the result decision is allowed.
If a grant matches the principal and resource but lacks the requested
permission, the decision remains denied.
An iam_allowed_principals explain finding has status: "context" because
lfpolicy does not model the caller's AWS IAM authorization. Do not convert that
context finding into an allowed decision.
When an LLM agent summarizes a review bundle, use this order:
- State the review
statusandrecommended_action. - If blocked, list
blocking_reasonsand stop. - Summarize planned safe changes.
- Summarize approval-required risks and their tickets or missing metadata.
- Point to
explain-batchfor current access decisions. - Avoid saying "failed" unless
statusisblocked.
Good wording:
검토 필요입니다. 차단 사유는 없습니다. 다만 broad permission grant가 있어
승인 필요 항목으로 표시됩니다. 티켓/승인자/만료일을 확인한 뒤 진행하세요.
Bad wording:
오류가 있으므로 권한 부여가 불가능합니다.
That wording incorrectly treats severity: "error" as a hard block.
Exception records must include:
ticketownerapproved_byreasonexpires_at
Expired exceptions are hard-block candidates. Exceptions expiring soon and
exceptions where owner equals approved_by should be surfaced as review
warnings, not hidden.
- Do not infer approval from
passed,review_required, orapproval_required. - Do not trigger AWS write execution automatically from any JSON report.
- Do not use severity alone for workflow decisions.
- Do not describe review planned-grant evidence as effective-access evidence.
- Do not hide
hard_blockfindings behind a generic summary.