Azure / Azure/agent-openai-python-banking-assistant

[User Story] - Security Guardrails - PII - Implement Credit Card masking

Offen
#52 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Keine Sprachdaten
Sterne
2
Forks
5
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**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*

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Lesen Sie die vier betroffenen Agent-Dateien: app/copilot/app/agents/azure_chat/account_agent.py, azure_chat/payment_agent.py, foundry/payment_agent_foundry.py und foundry/account_agent_foundry.py. Beginnen Sie mit dem verknüpften Middleware-Beispiel und der Dokumentation von Agent Framework und führen Sie anschließend die vorhandenen Agent-Tests aus, sofern verfügbar. Die Aufgabe ist abgeschlossen, wenn vollständige Kreditkartennummern bis auf ihre letzten vier Ziffern maskiert werden und jeder betroffene Agent einen Unit-Test hat.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
backend, security
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
52/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.