#!/usr/bin/env python3
import argparse
PROFILES={
 'unsafe':dict(tool=False,egress=False,budget=False),
 'least-privilege':dict(tool=True,egress=False,budget=False),
 'hardened':dict(tool=True,egress=True,budget=True),
}
def run(name):
 p=PROFILES[name]
 print('attack=indirect_prompt_injection')
 print(f'profile={name}')
 print(f'tool_action={"DENIED" if p["tool"] else "ALLOWED"}')
 print(f'egress={"BLOCKED" if p["egress"] else "OPEN"}')
 print(f'budget={"ENFORCED" if p["budget"] else "UNBOUNDED"}')
 if not p['tool'] and not p['egress']:
  print('impact=secret_exfiltration_possible');out='IMPACT_POSSIBLE'
 elif p['tool'] and p['egress'] and p['budget']:
  print('outcome=CONTAINED');out='CONTAINED'
 else:
  print('outcome=PARTIALLY_CONTAINED');out='PARTIAL'
 return out
if __name__=='__main__':
 ap=argparse.ArgumentParser();ap.add_argument('--profile',choices=PROFILES,default='hardened');ap.add_argument('--self-test',action='store_true');a=ap.parse_args()
 if a.self_test:
  assert run('unsafe')=='IMPACT_POSSIBLE';assert run('hardened')=='CONTAINED';print('PASS security_controls_contain_effects')
 else:run(a.profile)
