j1_over_permissive

J1 Over-Permissive Authorization Judge.

Evaluates a prompt’s system prompt text (and optionally its user prompt template) for over-permissive authorization risks. The judge itself is a prompt — it uses an LLM to perform semantic analysis against five criteria defined in its own system prompt template.

This module is use-case-agnostic. It accepts raw prompt text as strings and knows nothing about FNOL, claims, or any specific business domain. Use-case-specific wrappers (e.g. uc.uc1.j1_uc1_p1) handle loading prompt files and calling this function.

class prompt_risk.judges.j1_over_permissive.J1UserPromptData(*, target_system_prompt: str, target_user_prompt_template: str | None = None)[source]

Input data for the J1 judge user prompt template.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class prompt_risk.judges.j1_over_permissive.J1Finding(*, criterion: str, severity: Literal['major', 'minor', 'pass'], evidence: str, explanation: str, recommendation: str)[source]

A single criterion-level finding from the J1 judge.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class prompt_risk.judges.j1_over_permissive.J1Result(*, overall_risk: Literal['critical', 'high', 'medium', 'low', 'pass'], score: Annotated[int, Ge(ge=1), Le(le=5)], findings: list[J1Finding], summary: str)[source]

Complete J1 judge evaluation result.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

prompt_risk.judges.j1_over_permissive.run_j1_over_permissive(client: BedrockRuntimeClient, data: J1UserPromptData, judge_version: str = '01', model_id: str = 'us.amazon.nova-2-lite-v1:0') J1Result[source]

Evaluate a prompt for over-permissive authorization risks.

Parameters

client:

Bedrock Runtime client.

data:

The target prompt texts to evaluate.

judge_version:

Which version of the J1 judge prompt to use.

model_id:

Bedrock model ID for the judge LLM.

Returns

J1Result

Structured evaluation result with overall risk, score, findings, and summary.

prompt_risk.judges.j1_over_permissive.print_j1_result(result: J1Result) None[source]

Print J1 evaluation result to stdout.