Implement Simulated Secure Data Tools

implementationChallenge

Prompt Content

Develop Python classes that simulate secure access to personal data (Gmail, Google Photos). These tools should expose methods like `read_emails(user_id, consent_level)` or `analyze_photos(user_id, tags, consent_level)`. Crucially, each method must check a `consent_level` parameter before returning any data, simulating a secure access mechanism. Integrate these as custom tools for your Google ADK agent. 

```python
from google_adk.tools import Tool, tool_decorator
# from vertexai.preview.generative_models import GenerativeModel

# @tool_decorator
# class SimulatedGmailReader(Tool):
#    def call(self, user_id: str, consent_level: dict):
#        if consent_level.get('email') == 'full':
#            # Simulate fetching emails
#            return [{"subject": "Meeting", "body": "Details..."}]
#        return "Access denied to email data."

# agent = create_agent(model=GenerativeModel("gemini-2.5-pro"), tools=[SimulatedGmailReader()])
# agent.run_conversation("user123", "Summarize my latest emails.")
```

Try this prompt

Open the workspace to execute this prompt with free credits, or use your own API keys for unlimited usage.

Usage Tips

Copy the prompt and paste it into your preferred AI tool (Claude, ChatGPT, Gemini)

Customize placeholder values with your specific requirements and context

For best results, provide clear examples and test different variations