SurgeGuard-Agent: Consent-Aware Healthcare AI Security & Risk Monitoring

Inspiration

Healthcare is one of the most important areas where artificial intelligence can make a meaningful difference. However, I realized that building intelligent healthcare systems is not just about predicting risks or automating tasks. It is also about protecting sensitive patient information and ensuring that automated systems operate responsibly.

This inspired me to develop SurgeGuard-Agent, an educational healthcare workflow prototype that combines simulated surgical risk monitoring, hospital inventory coordination, and consent-aware security verification.

My initial idea was to create a system that could monitor simulated surgical conditions and identify potential operational risks. As I developed the project further, I recognized another challenge: What happens when an AI agent attempts to access patient information without valid consent?

That question motivated me to introduce a separate security layer that verifies access permissions before allowing simulated healthcare data requests.

What It Does

SurgeGuard-Agent demonstrates three connected healthcare workflow capabilities:

1. Simulated Surgical Risk Monitoring

The system accepts simulated movement measurements and sensor conditions to generate rule-based alerts. It distinguishes between normal conditions and situations requiring review.

2. Healthcare Inventory Monitoring

The dashboard checks simulated medical supply availability and produces stock notifications based on requested quantities. This demonstrates how operational monitoring could support healthcare supply coordination.

3. Consent-Aware Security Verification

The security component evaluates healthcare information requests against three conditions:

  • Patient identity consistency: Does the requested patient identifier match the authorized identifier?
  • Consent scope: Is the requested information category permitted?
  • Consent validity: Has the authorization expired?

Requests that satisfy all three conditions receive an ALLOW decision. Requests that fail any condition receive BLOCK, along with an explanation.

The application also provides downloadable CSV evaluation records and session-level security audit logs.

How I Built It

I developed SurgeGuard-Agent using Python, Streamlit, Visual Studio Code, and Dify workflow prototyping.

The implementation includes:

  • Python: Core application logic, risk monitoring, inventory verification, and consent checks.
  • Streamlit: Interactive dashboard for simulated healthcare inputs, alerts, authorization decisions, and audit records.
  • Dify: Earlier experiments with workflow orchestration and API integration.
  • Pandas: Organizing and exporting evaluation data.
  • GitHub: Source code management, documentation, and project sharing.

I separated the application into independent modules so that operational monitoring and security decisions could be tested individually.

The security_guard.py module performs deterministic consent verification. Rather than allowing an AI model to decide whether an access request appears trustworthy, it compares structured authorization information against predefined rules.

I created test_security.py to evaluate five consent-security scenarios and combine_reports.py to consolidate the security and healthcare simulation results.

The deployed Streamlit demonstration can operate using local Python rules without requiring a configured Dify API key.

Challenges I Faced

1. Moving from healthcare automation to healthcare security

My original project focused on simulated surgical monitoring and inventory coordination. One of my biggest challenges was understanding that a functional healthcare dashboard does not automatically provide secure information access.

I addressed this by creating a separate consent-verification component.

2. Designing trustworthy authorization decisions

I explored how untrusted instructions could influence automated workflows. Instead of relying on an AI-generated safety judgment, I implemented structured checks for patient identifiers, consent scopes, and expiration timestamps.

3. Integrating multiple technologies

Connecting Python scripts, earlier Dify workflows, Streamlit components, and CSV evaluation reports required debugging and repeated testing.

I learned to isolate errors, test individual modules, and verify outputs before integrating components.

4. Understanding security limitations

Another important challenge was distinguishing successful demonstration tests from real-world security guarantees.

Although the implemented checks passed the selected tests, the prototype does not yet provide independent identity authentication, cryptographic consent verification, real-time consent revocation, or mandatory enforcement across actual AI agent tool calls.

Accomplishments That I'm Proud Of

I successfully developed and published an interactive healthcare workflow prototype with a separate consent-security component.

My recorded evaluations include:

Evaluation Result
Consent-security tests 5/5 passed
Healthcare simulation scenarios 4/4 passed
Combined evaluation records 9
Security decision outcomes ALLOW / BLOCK
Evaluation exports CSV files

The security tests covered valid consent, mismatched patient identifiers, unauthorized information scopes, expired consent, and an untrusted instruction accompanying an unauthorized request.

These results demonstrate that the implemented rules behaved as expected in the selected scenarios. They do not establish production-level security or generalized prompt-injection resistance.

What I Learned

Building SurgeGuard-Agent helped me understand several important concepts:

  • How to develop modular Python applications.
  • How to create interactive dashboards using Streamlit.
  • How to experiment with workflow orchestration using Dify.
  • How to implement deterministic authorization checks.
  • Why patient consent, access scope, and expiration matter in healthcare information systems.
  • How to design reproducible security tests and export evaluation results.
  • Why explicit trust assumptions and honest limitations are essential in AI security projects.

Most importantly, I learned that responsible AI is not only about making systems intelligent; it is also about ensuring that automated decisions respect clear security boundaries.

What's Next for SurgeGuard-Agent

My future development plans include:

  1. Connecting a simulated AI agent's tool requests directly to the consent-verification module.
  2. Adding stronger identity authentication and consent validation.
  3. Exploring consent revocation and more detailed audit mechanisms.
  4. Expanding adversarial security testing and performance evaluation.
  5. Improving the dashboard with clearer explanations and additional workflow simulations.
  6. Investigating interoperability with standards-based healthcare systems using safe, fictional test environments.

The long-term goal is to explore how healthcare automation can become more transparent, secure, and accountable.

Project Links

Live Demo: https://surgeguard-agent-bafgymxyjjjd5vmctrbmo3.streamlit.app/

GitHub Repository: https://github.com/preethidavidson249140/SurgeGuard-Agent

Final Thoughts

SurgeGuard-Agent represents my journey from building a healthcare monitoring dashboard to exploring the security responsibilities of automated healthcare systems.

As a computer science student specializing in artificial intelligence, this project helped me connect software development, workflow automation, security testing, and responsible AI design.

My guiding principle is simple: Healthcare automation should not only respond to risks—it should also respect the permissions and trust boundaries that protect patients.

Disclaimer: SurgeGuard-Agent is an educational prototype using fictional healthcare information. It is not a clinical decision-support system and does not access real patient records or live ABDM/ABHA services.

Built With

  • cybersecurity
  • data-security
  • diffy
  • pandas
  • python
  • visual-studio-code
Share this project:

Updates

Submission history