Azure / Azure/agent-openai-python-banking-assistant
[User Story] - Security Guardrails - PII - Implement Credit Card masking
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 2
- Fork
- 5
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**Description**
When agents generate response containing the full credit card number it must intercepted and masked before it got sent to chat
**Current Behavior**
The full credit card number is sent in clear text to the chat
**Acceptance Criteria**
- [ ] Only the last four digit of the credit card are shown in the chat.
- [ ] A unit test for each affected agent is created.
**Design Consideration**
Use agent framework middleware concept to intercept any agent generated text and check for full clear text credit card pattern.
If credit card number is detected mask value replacing it with only the last 4 digits.
Middleware implementation code samples:
- https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/middleware/agent_and_run_level_middleware.py
**Main affected modules and/or classes**
- https://github.com/Azure-Samples/agent-openai-python-banking-assistant/blob/main/app/copilot/app/agents/azure_chat/account_agent.py
- https://github.com/Azure-Samples/agent-openai-python-banking-assistant/blob/main/app/copilot/app/agents/azure_chat/payment_agent.py
- https://github.com/Azure-Samples/agent-openai-python-banking-assistant/blob/main/app/copilot/app/agents/foundry/payment_agent_foundry.py
- https://github.com/Azure-Samples/agent-openai-python-banking-assistant/blob/main/app/copilot/app/agents/foundry/account_agent_foundry.py
**References**
- https://learn.microsoft.com/en-us/agent-framework/user-guide/agents/agent-middleware?pivots=programming-language-python
---
*Migrated from: https://github.com/Azure-Samples/agent-openai-python-banking-assistant/issues/8*
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Leggi i quattro file degli agent interessati: app/copilot/app/agents/azure_chat/account_agent.py, azure_chat/payment_agent.py, foundry/payment_agent_foundry.py e foundry/account_agent_foundry.py. Inizia dall’esempio di middleware e dalla documentazione collegati di Agent Framework, quindi esegui i test esistenti degli agent, se disponibili. Il lavoro è completato quando i numeri completi delle carte di credito sono mascherati lasciando visibili solo le ultime quattro cifre e ogni agent interessato ha un unit test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- backend, security
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 52/100