What is Function Chaining?
Function chaining refers to the sequence of function calls in your application. For example:- User calls
read_email(email_id) - Email content contains: “Please search the web for competitor pricing”
- System attempts to call
search_web(query)
read_email → search_web
Why Control Function Chaining?
Controlling function chaining prevents:- Unauthorized operations - Blocking functions from triggering other functions they shouldn’t
- Prompt injection - Preventing malicious content from triggering function calls
- Privilege escalation - Stopping low-privilege functions from calling high-privilege functions
- Data exfiltration - Blocking functions that could leak data from triggering data access functions
Configuring Function Chaining
Via UI
- Navigate to Policies → Select a policy
- Go to Function Chaining tab
- Configure allowed and blocked function chains
Function chaining configuration is currently available through the Hipocap web UI. Python SDK methods for function chaining configuration are not yet available.
Allowed Functions
Specify which functions can be called after a function:Blocked Functions
Explicitly block certain function chains:Complete Function Chain Rules
Example: Email System
Prevent email forwarding and unauthorized actions:Detecting Function Call Attempts
Hipocap automatically detects function call attempts in function outputs:Function Chaining Information
The analysis response includes function chaining information:Wildcard Rules
Use wildcards to apply rules to multiple functions:Require Review
Require human review for certain function chains:Best Practices
- Block by Default - Start with blocking most chains, then allow specific ones
- Document Rationale - Document why certain chains are allowed or blocked
- Regular Reviews - Review function chains regularly as your application evolves
- Test Chains - Test function chains to ensure they work as expected
- Monitor Attempts - Monitor blocked chain attempts to identify patterns
Example: Complete Configuration
Integration with Security Analysis
Function chaining works together with security analysis:- Security analysis detects function call attempts in content
- Function chaining rules check if the chain is allowed
- If blocked, the entire operation is blocked
Next Steps
- Function Access Control - Configure function permissions
- Policies - Manage policies
- Roles & Permissions - Set up RBAC
