def METHOD_NAME(agent_execution_permission_id: int,
                                      agent_execution_permission: AgentExecutionPermissionIn,
                                      Authorize: AuthJWT = Depends(check_auth)):
    """
    Update an AgentExecutionPermission in the database.
    Given an agent_execution_permission_id and the updated agent_execution_permission, this function updates the
    corresponding AgentExecutionPermission in the database. If the AgentExecutionPermission is not found, an HTTPException
    is raised.
    Args:
        agent_execution_permission_id (int): The ID of the AgentExecutionPermission to update.
        agent_execution_permission : The updated AgentExecutionPermission object as json.
        Authorize (AuthJWT, optional): Dependency to authenticate the user.
    Returns:
        db_agent_execution_permission (AgentExecutionPermission): The updated AgentExecutionPermission in the database.
    Raises:
        HTTPException: If the AgentExecutionPermission is not found in the database.
    """
    db_agent_execution_permission = db.session.query(AgentExecutionPermission).get(agent_execution_permission_id)
    if not db_agent_execution_permission:
        raise HTTPException(status_code=404, detail="Agent execution permission not found")
    for key, value in agent_execution_permission.dict().items():
        setattr(db_agent_execution_permission, key, value)
    db.session.commit()
    return db_agent_execution_permission