+
    iHàj«  ã                  óÚ   € R t ^ RIHt ^ RIt^ RIHtHt ^ RIHt	H
t
 ]P                  ! R4      t]P                  ! R4      t]P                  ! R4      tR R	 ltR
RRRR]	/R R lltRR.tR# )aŽ  Redaction applied to monitoring data before egress.

One unconditional scrub, no modes, no knobs. Every string that leaves the process passes
through ``redact_for_export``: secrets via ``agent/redact.py::redact_for_egress`` (the single
pattern source; fails CLOSED so a broken redactor never emits the raw string), then PII
(e-mail, phone, UUID-shaped ids -> ``[email]`` / ``[phone]`` / ``[id]``).
)ÚannotationsN)ÚAnyÚOptional)ÚREDACTION_UNAVAILABLEÚredact_for_egressz0[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}zd(?<!\w)(?:\+?\d{1,3}[\s.\-]?)?(?:\(\d{2,4}\)[\s.\-]?)?\d{3}[\s.\-]?\d{3,4}(?:[\s.\-]?\d{2,4})?(?!\w)zO\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\bc               ó    € V ^8„  d   QhRRRR/# )é   ÚtextzOptional[str]Úreturn© )Úformats   "Ú?/home/ubuntu/.hermes/hermes-agent/agent/monitoring/redaction.pyÚ__annotate__r      s   € ÷ ñ ˜Mð ¨mñ ó    c                ó¾   € V f   R# \        \        V 4      4      p\        P                  RV4      p\        P                  RV4      p\
        P                  RV4      pV# )z<Scrub a string for egress: secrets, then PII. Unconditional.Nz[email]z[id]z[phone])r   ÚstrÚ	_EMAIL_REÚsubÚ_UUID_REÚ	_PHONE_RE)r	   Úouts   & r   Úredact_for_exportr      sM   € à‚|ÙÜ
œC ›IÓ
&€CÜ
�-‰-˜	 3Ó
'€CÜ
�,‰,�v˜sÓ
#€CÜ
�-‰-˜	 3Ó
'€CØ€Jr   Úlimitiô  Úemptyz
[redacted]Úunavailablec          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r   Úrawr   r   Úintr   r   r   r
   r   )r   s   "r   r   r   $   s1   € ÷ ñ ˜ð  sð ¸ð ÐZ]ð Ðpsñ r   c               ó€   €  \        \        T ;'       g    R4      4      ;'       g    TRV #   \         d    Tu # i ; i)zŠRedact ``str(raw or "")`` and length-bound it; ``empty`` replaces an empty
result, ``unavailable`` is returned if redaction itself raises.Ú N)r   r   Ú	Exception)r   r   r   r   s   &$$$r   Úredact_boundedr!   $   s@   € ðÜ!¤# c§i i¨R£.Ó1×:Ð:°U¸F¸UÐCÐCøÜô ØÒðús   ‚- •- §- ­=¼=r!   r   )Ú__doc__Ú
__future__r   ÚreÚtypingr   r   Úagent.redactr   ÚUNAVAILABLEr   Úcompiler   r   r   r   r!   Ú__all__r   r   r   Ú<module>r*      sx   ðñõ #ã 	ß  ç Pð �JŠJÐJÓK€	à�JŠJØkó€	ð �:Š:ÐhÓi€õð¨Sð ¸|ð Ð`k÷ ð Ð0Ð
1‚r   